HaxeFoundation / HaxeFoundation/haxe
`@:from macro` does not allow implicit casting from abstracts.
Open
platform-macro
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
```haxe
import haxe.macro.Expr;
import haxe.macro.Context;
class Test {
static function main() {
print("Hello"); // works fine
var val:MyString = "Hello";
print(val); // Error: MyString should be Message
}
static function print(msg:Message) {
trace(msg);
}
}
abstract MyString(String) from String to String {}
abstract Message(Dynamic) from Dynamic {
@:from macro static function from(value:ExprOf):ExprOf {
return macro Std.string($value);
}
}
```
http://try-haxe.mrcdk.com/#0A63B
Contributor guide
Assessment
This issue has not been assessed yet.