Closed
Description
This code reproduce the issue where it is compiled into SWF.
Expected: a.g(0)
returns the same value as a.f(0)
Result: a.g(0)
throws TypeError: Error #1006
abstract A(String)
{
public inline function new(s : String)
{
this = s;
}
public function f(index : Int) : Int
{
return StringTools.fastCodeAt(this, index);
}
public inline function g(index : Int) : Int
{
return StringTools.fastCodeAt(this, index);
}
}
class Test
{
public static function main()
{
try {
var a = new A("a");
trace(a.f(0));
trace(a.g(0));
} catch (e : Dynamic) {
trace(e);
}
}
}
Metadata
Metadata
Assignees
Labels
No labels
Activity