-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect handling of generics such as Vector<T> or Dictionary<K, V> #528
Comments
Another sample: http://try.haxe.org/#628a0 class Test {
static function main() {
var vector = new Array<String> ();
vector.push ("Hello");
for (value in vector) {
trace (value.length); // error in IDE
}
}
} |
Duplicate of #25, which has some more extensive examples. |
After some research into why Array works, but OpenFls's Vector class and Flixel's FlxSprite class don't, I've come to the preliminary conclusion that the error lies with the plugin's inability to deal with in-line conditional compilation directives. (That is: #if, #else, #elseif, and #end, appearing within a code line, rather than on lines by themselves.) Time to revisit this issue, since fixing it will likely fix a host of other issues: see #29, #115, #417, #516. |
So, I proved myself wrong. The problem lies in the semantic annotator's (and the type resolver's) inability to track the current type through dynamic variables properly. Rather than extend the semantic annotator, I looked into compiler completion and got that working. See PR #543 for the fix. Leaving this open, though, because we're still reporting the errors. |
Although the editor handles generics in Array correctly, iterating over custom types incorrectly reports errors
Flowplay is interested in paying to support the development of this and other issues:
#529
#530
#531
Thanks everyone 😄
The text was updated successfully, but these errors were encountered: