HaxeFoundation / HaxeFoundation/haxe
Type param @:const abstract with constructor fails.
Open
feature-generic
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
```haxe
//compiler errors: Type parameter is expected to be a constant value
@:generic
abstract Data<@:const V:Int>(Any) {
public function new() {} //specfically the failure begins when the new function is typed, without a constructor it works.
}
//it works without a new constructor
@:generic
abstract Data3<@:const V:Int>(Any) {}
//the class version works
@:generic
class Data2<@:const V:Int> {
public function new() {}
}
```
https://try.haxe.org/#30254cf2
Tested on latest nightly through 3.4.7 same result.
Contributor guide
Assessment
This issue has not been assessed yet.