-
-
Couldn't load subscription status.
- Fork 689
Closed
Milestone
Description
Considering the following code
class EnExtension {
public static function toS(e: En): String {
return '${e}';
}
public static function fromS(en: Enum<En>, st: String): En {
return A;
}
}
@:using(Test.EnExtension)
enum En {
A;
B;
}
class Test {
static public function main() {
var e: En = A;
trace(e.toS());
var f: En = En.fromS("A"); // Error ?
}
}The similar thing also happen with Class<>
class CExtension {
public static function toS(c: C): String {
return 'c';
}
public static function fromS(cls: Class<C>, s: String) {
return new C();
}
}
@:using(Test.CExtension)
class C {
public function new(){}
}
class Test {
static public function main() {
var c = new C();
trace(c.toS());
var d = C.fromS('c'); // Error ?
trace(d);
}
}This don't seems to be a problem with static extensions but rather a problem with @:using. By explicitly defining using Test.CExtensions and using Test.EnExtensions, the code will run just fine.
Couldn't find an existing issues regarding this, if there is one, kindly just close the issue.
Metadata
Metadata
Assignees
Labels
No labels