haxe
haxe copied to clipboard
Odd regression in `from` structure.
Minimal example:
package ;
function main() {
var cfg:DialogConfig = {
priority: 0,
ui: (null:RenderResult),
};
}
@:forward
abstract DialogConfig(DialogConfigData) from DialogConfigData {
@:from static function fromRenderResult(r:RenderResult):DialogConfig
return { priority: 0, ui: r };
}
typedef DialogConfigData = {
final priority:Int;
final ui:DialogUi;
}
@:callable
abstract DialogUi((close:()->Void)->RenderResult) from (close:()->Void)->RenderResult {
inline function new(f) this = f;
@:from static function fromRenderResult(r:RenderResult)
return new DialogUi(_ -> r);
}
abstract RenderResult(String) to String from String {}
This broke somewhere between a8f2911 and fa582e3. Can't track it down any further as there are no nightlies in-between, but FWIW it looks like it might be related to 5345c4d.
Changing the last line to typedef RenderResult = String; makes it compile too.