Skip to content

Commit

Permalink
Fix issue with specifics where TypeParameter was not assignable to En…
Browse files Browse the repository at this point in the history
…umType due to Class<T> wrapping
  • Loading branch information
m0rkeulv committed Apr 27, 2024
1 parent 29e5fef commit ca52e67
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -706,14 +706,17 @@ static private boolean canAssignToFromSpecificType(
if (toSpecific.isEnumValueClass() && fromSpecific.isEnumType()) return true;
}
}

boolean toSpecIsEnum = false;
if(toSpecific != null ) {
SpecificHaxeClassReference specific = wrapType(toHolder, to.context, toSpecific.isEnumType());
toSpecIsEnum = toSpecific.isEnumType();
SpecificHaxeClassReference specific = wrapType(toHolder, to.context, toSpecIsEnum);
// recursive protection
if(referencesAreDifferent(to, specific)) toSpecific = specific;
}
if(fromSpecific != null ) {
SpecificHaxeClassReference specific = wrapType(fromHolder, from.context, fromSpecific.isEnumType());
boolean useEnumWrapper = fromSpecific.isEnumType();
if (toSpecIsEnum && fromSpecific.isTypeParameter()) useEnumWrapper = true;
SpecificHaxeClassReference specific = wrapType(fromHolder, from.context, useEnumWrapper);
// recursive protection
if(referencesAreDifferent(from, specific)) fromSpecific = specific;
}
Expand Down

0 comments on commit ca52e67

Please sign in to comment.