Skip to content

Commit 3ee78dc

Browse files
committed
treating assign to Expr as if it was dynamic
1 parent c25fab0 commit 3ee78dc

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/main/java/com/intellij/plugins/haxe/model/type/HaxeTypeCompatible.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ static public boolean canAssignToFrom(
159159
from = classReference.fullyResolveTypeDefAndUnwrapNullTypeReference();
160160
}
161161
}
162+
// 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.
163+
if (to.isExpr())return true;
162164
if (to.isAny()) return true;
163165
if (to.isDynamic() || from.isDynamic()) return true;
164166
if (to.isEnumValueClass() && isEnum(from)) return true;

src/main/java/com/intellij/plugins/haxe/model/type/SpecificHaxeClassReference.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,6 @@ public ResultHolder access(String name, HaxeExpressionEvaluatorContext context,
290290
return null;
291291
}
292292

293-
public void isExprOf() {
294-
}
295293

296294
public enum Compatibility {
297295
ASSIGNABLE_TO, // Assignable via @:to or "to <Type>" on an abstract.

src/main/java/com/intellij/plugins/haxe/model/type/SpecificTypeReference.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,4 +613,11 @@ private static boolean hasSameQualifiedInfo(HaxeClassModel thisModel, HaxeClassM
613613
}
614614

615615

616+
public boolean isExpr() {
617+
if (this instanceof SpecificHaxeClassReference classReference) {
618+
HaxeClass aClass = classReference.getHaxeClass();
619+
return aClass != null && aClass.getQualifiedName().equalsIgnoreCase("haxe.macro.Expr");
620+
}
621+
return false;
622+
}
616623
}

0 commit comments

Comments
 (0)