HaxeFoundation / HaxeFoundation/haxe
Multitype abstract from calling to
Open
feature-abstracts
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
```haxe
interface IA {}
@:multiType
abstract Above(IA) {
public function new(v);
@:from static inline function fromInt(v:Int) return (v:Above);
@:from static inline function fromFloat(v:Float) return (v:Above);
@:to static inline function toInt(t:IA, v) return {value:v, type:TInt};
@:to static inline function toFloat(t:IA, v) return {value:v, type:TFloat};
}
var a1 = new Above(0);
a1 = 1;
var a2 = new Above(0);
```
Shouldn't (v:Above\) at fromInt call toInt in above example? Instead, a1 = 1 makes a1 an object, casting 1 to object, being not inlined like a2
Contributor guide
Assessment
This issue has not been assessed yet.