back2dos / tinkerbell

MIT License
83 stars 8 forks source link

confusing error message when missing type in init during def #30

Closed raould closed 9 years ago

raould commented 11 years ago

class Test implements tink.lang.Cls { var x:Int = _; var y = x+1; // y:Int fixes it.

static function main() { var t = new Test( 2 ); trace( t ); } }

haxe -main Test -neko n.n -lib tink_lang ./Test.hx:4: characters 10-11 : Unknown identifier : x /usr/lib/haxe/lib/tinklang/0,2,4/tink/lang/Cls.hx:10: characters 3-12 : Build failure ./Test.hx:3: characters 14-15 : Unknown identifier : ./Test.hx:4: characters 10-11 : Cannot access x in static function

back2dos commented 11 years ago

Well, the problem is, that it this point, x is unknown. I'll see whether I can somehow work around this or at least produce a better error message.