HaxeFoundation / HaxeFoundation/haxe
Can't use abstract with @:forwardStatics as enum parameter
Open
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
This code does not compile. Removing `@:forwardStatics` makes it work.
https://try.haxe.org/#E60cC
@:forwardStatics
abstract AFoo(Foo) from(Foo) {}
class Foo {
public function new() {}
}
enum Bar {
EFoo(foo:AFoo);
}
class Main {
static function main() {
var t = Bar.EFoo(new Foo());
switch(t) {
case EFoo(foo): trace(foo); // Class has no field foo
}
}
}
Contributor guide
Assessment
This issue has not been assessed yet.