MVCoconut / coconut.data

Observable Data Layer.
The Unlicense
20 stars 8 forks source link

Coconut fails to cast abstract from Value<T> in hxx #63

Closed serjek closed 3 years ago

serjek commented 4 years ago

Consider having the following:

@:forward
abstract LanguageString(String) from String to String {}

typedef DialogData = {
   final header:Value<LanguageString>;
}
//in hxx
@:attr var data:DialogData;
function render() <Text>${data.header}</Text>;

This will give compilation error: Array<coconut.data.Value<LanguageString>> should be Null<react.ReactFragment> unless provided with type hint like so <Text>${(item.header:String)}</Text>.

This seem to be a regression as this was working with older versions.

serjek commented 4 years ago

I am not sure where this belongs to, UI, hxx or here, so I added it to coconut.data because error message told me so.

back2dos commented 3 years ago

This is probably more of a Haxe 4.2. issue. If you add @:transitive to LanguageString it should work again.