Try the following in
try.haxe.org:
using Lambda;
class Test {
static function main() {}
}
class TYPE {
public function new() {}
public function iterator():Iterator<Int> return new IntIterator(0, 1);
}
abstract ABSTRACT(TYPE) {
public var array(get, never):Bool;
function get_array() return true;
public function new() {
this = new TYPE();
$type(array);
$type(this.array);
}
}
Output:
Test.hx:15: characters 14-19 : Warning : Void -> Array<Int>
Test.hx:16: characters 14-24 : Warning : Void -> Array<Int>
It is the Lambda.array<A>(it:Iterable<A>):Array<A> function.
This means that "using" just deletes possible field names, even inside the definition of the abstract.
I encountered this when an order(get, never):Int of a Matrix class showed up as 20 errors of "order : Iterable<Int> -> Iterable<math.vectors.Int2> should be Int" because of an iterator. Am I just not allowed to use that name?
I can see "this.array" being the static extension, but not "array".