Skip to content

Commit

Permalink
avoid cast error on hl
Browse files Browse the repository at this point in the history
  • Loading branch information
ianharrigan committed Oct 28, 2024
1 parent 2433a5d commit 03a6eec
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions haxe/ui/util/Variant.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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
}
}
}
Expand Down

0 comments on commit 03a6eec

Please sign in to comment.