From 03a6eec6b32962f4b889b5bbef9518631db0601e Mon Sep 17 00:00:00 2001 From: Ian Harrigan Date: Mon, 28 Oct 2024 08:46:42 +0100 Subject: [PATCH] avoid cast error on hl --- haxe/ui/util/Variant.hx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/haxe/ui/util/Variant.hx b/haxe/ui/util/Variant.hx index c349082d..d78748f2 100644 --- a/haxe/ui/util/Variant.hx +++ b/haxe/ui/util/Variant.hx @@ -511,7 +511,13 @@ abstract Variant(VariantType) from VariantType { } else if ((r is String)) { v = cast(r, String); } else { + #if hl // avoid cast error, until we can move away from Variant + if (Type.typeof(r) != TObject) { + v = r; + } + #else v = r; + #end } } else { if ((r is Component)) { @@ -530,7 +536,13 @@ abstract Variant(VariantType) from VariantType { } else if ((r is ImageData)) { v = cast(r, ImageData); } else { + #if hl // avoid cast error, until we can move away from Variant + if (Type.typeof(r) != TObject) { + v = r; + } + #else v = r; + #end } } }