intellij-haxe
intellij-haxe copied to clipboard
Another unresolved symbol
Unresolved symbol here is "m.word". But it compiles and runs fine, I wonder why...
package ;
import haxe.ds.Vector;
class Thing{
public function new(){}
public var word:String;
}
class Main {
public static function main(){
new Main();
}
var vec(default, null):Vector<Thing>;
public function new(){
vec = new Vector(1);
vec.set(0, new Thing());
var m = this.vec[0];
m.word = "Hi there!";
trace(m.word);
}
}
Most likely because the plugin wasn't able to tell that the type of vec[0] was a Thing. The plugin code that tries to do type inference is incomplete. (There is a branch that @Soywiz has created where inference support is more complete, but it's also buggy. We're working on it -- slowly.)
Seems fixed in the latest version of the plugin. I think this issue may be closed.
No, this isn't fixed yet. It still exists in 1.3.1. The code that looks up the type (parameter of 'T') of vec doesn't deal well with monomorphs, nevermind those set through an @op([]) metadata.