Skip to content

Commit

Permalink
attempt to guess (convert) the property type
Browse files Browse the repository at this point in the history
  • Loading branch information
ianharrigan committed Apr 26, 2024
1 parent 4bec569 commit 11979dc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion haxe/ui/macros/Macros.hx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import haxe.ui.macros.helpers.FieldBuilder;
import haxe.ui.util.EventInfo;
import haxe.ui.util.RTTI;
import haxe.ui.util.StringUtil;
import haxe.ui.util.TypeConverter;

using StringTools;

Expand Down Expand Up @@ -142,7 +143,8 @@ class Macros {
}
var propName = key.split(".").pop();
var propValue = ModuleMacros.properties.get(key);
createDefaultsFn.add(macro $i{propName} = $v{propValue});
var convertedPropValue = TypeConverter.convertFrom(propValue);
createDefaultsFn.add(macro $i{propName} = $v{convertedPropValue});
}
}
}
Expand Down

0 comments on commit 11979dc

Please sign in to comment.