From 285d82d1a74e4a741a8eed1478264207845d2bf2 Mon Sep 17 00:00:00 2001 From: Ian Harrigan Date: Sun, 28 Jul 2024 09:19:45 +0200 Subject: [PATCH] explicitly add hidden to RTTI (its not a behaviour so wont happen auto) --- haxe/ui/macros/Macros.hx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/haxe/ui/macros/Macros.hx b/haxe/ui/macros/Macros.hx index d7570208c..476ef51ce 100644 --- a/haxe/ui/macros/Macros.hx +++ b/haxe/ui/macros/Macros.hx @@ -581,6 +581,14 @@ class Macros { } } + // "hidden" isnt actually a behaviour (currently), however, we would like it in the RTTI so we can do + // automatic type conversions, but since its just a normal getter / setter it will never be included + // in this code, so we'll add it manually - it might make sense later to have some @:add-rtti type + // metadata, but for now, an explicit, obvious list is clearer + if (builder.fullPath == "haxe.ui.core.Component") { + RTTI.addClassProperty(builder.fullPath, "hidden", "bool"); + } + for (f in fields) { RTTI.addClassProperty(builder.fullPath, f.name, ComplexTypeTools.toString(f.type)); if (f.name == valueField) {