intellij-haxe icon indicating copy to clipboard operation
intellij-haxe copied to clipboard

Another unresolved symbol

Open mathemaudio opened this issue 8 years ago • 3 comments

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);
  }
}

screenshot_3

mathemaudio avatar May 10 '16 12:05 mathemaudio

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.)

EBatTiVo avatar May 10 '16 18:05 EBatTiVo

Seems fixed in the latest version of the plugin. I think this issue may be closed.

demurgos avatar Sep 14 '19 21:09 demurgos

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.

EricBishton avatar Oct 26 '20 07:10 EricBishton