Skip to content

Commit

Permalink
treating assign to Expr as if it was dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
m0rkeulv committed Feb 22, 2024
1 parent c25fab0 commit 3ee78dc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ static public boolean canAssignToFrom(
from = classReference.fullyResolveTypeDefAndUnwrapNullTypeReference();
}
}
// We allow any expression to be assign to Expr and treating it kinda like Dynamic as we currently dont have any real way of type compare.
if (to.isExpr())return true;
if (to.isAny()) return true;
if (to.isDynamic() || from.isDynamic()) return true;
if (to.isEnumValueClass() && isEnum(from)) return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,6 @@ public ResultHolder access(String name, HaxeExpressionEvaluatorContext context,
return null;
}

public void isExprOf() {
}

public enum Compatibility {
ASSIGNABLE_TO, // Assignable via @:to or "to <Type>" on an abstract.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -613,4 +613,11 @@ private static boolean hasSameQualifiedInfo(HaxeClassModel thisModel, HaxeClassM
}


public boolean isExpr() {
if (this instanceof SpecificHaxeClassReference classReference) {
HaxeClass aClass = classReference.getHaxeClass();
return aClass != null && aClass.getQualifiedName().equalsIgnoreCase("haxe.macro.Expr");
}
return false;
}
}

0 comments on commit 3ee78dc

Please sign in to comment.