HaxeFoundation / HaxeFoundation/haxe
The compiler doesn't understand type parameters in @:overload
Open
feature-overload
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
Revision: 0fc630d
``` haxe
var op:Operation = null;
op.run(function(c) c.next()); // Failed with: Operation.T has no field next
typedef Operation = {
@:overload(function(cb:T->Void):Void {})
function run():Void;
}
typedef Cursor = {
function next():Void;
}
```
The above code will fail to compile.
Changing `Operation` to the following will make it go through:
``` haxe
typedef Operation = {
@:overload(function():Void {})
function run(cb:T->Void):Void;
}
```
Contributor guide
Assessment
This issue has not been assessed yet.