Skip to content

Commit

Permalink
bugfix: fully resolve type before attempting to test operators
Browse files Browse the repository at this point in the history
  • Loading branch information
m0rkeulv committed Jul 15, 2024
1 parent 23c07eb commit c35e3c7
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,14 @@ static public SpecificTypeReference getBinaryOperatorResult(

// while normal abstracts should not be resolved to underlying type, there's an exception for Null<T>
// in this case we just "unwrap" without trying to resolve
if (left.isNullType()) {
left = ((SpecificHaxeClassReference)left).getSpecifics()[0].getType();

if (left instanceof SpecificHaxeClassReference classReference && (classReference.isTypeDef()|| classReference.isNullType() )) {
SpecificTypeReference resolved = classReference.fullyResolveTypeDefAndUnwrapNullTypeReference();
if (resolved != null) left = resolved;
}
if (right.isNullType()) {
right = ((SpecificHaxeClassReference)right).getSpecifics()[0].getType();
if (right instanceof SpecificHaxeClassReference classReference && (classReference.isTypeDef()|| classReference.isNullType() )) {
SpecificTypeReference resolved = classReference.fullyResolveTypeDefAndUnwrapNullTypeReference();
if (resolved != null) right = resolved;
}

SpecificHaxeClassReference intRef = SpecificHaxeClassReference.getInt(elementContext);
Expand Down

0 comments on commit c35e3c7

Please sign in to comment.