HaxeFoundation / HaxeFoundation/haxe
`@:generic` leaks type parameters
Open
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
The following code:
``` haxe
class Main {
static function main() {
Test2.somethingElse(10);
}
}
class Test {
@:generic public static function something(t:T) {
return t;
}
}
@:forward
abstract Test2(Test) {
@:extern inline public static function somethingElse(t:T) {
return Test.something(t);
}
}
```
Will generate the following `-D dump` for `Test.something`:
```
static public something_somethingElse_T(method) : t : somethingElse.T -> somethingElse.T
= function(t:somethingElse.T) = {
var tmp = t;
return tmp;
}
```
That `somethingElse.T` comes from the abstract type
Contributor guide
Assessment
This issue has not been assessed yet.