Skip to content

Commit

Permalink
making sure callies typeParameters are used when evaluating callExpre…
Browse files Browse the repository at this point in the history
…ssion and the typeParameters are not provided from arguments or other input.
  • Loading branch information
m0rkeulv committed Jan 14, 2025
1 parent 21b3d7a commit 952440d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ private HaxeCallExpressionEvaluation evaluate(boolean trackErrors, PsiElement so
argumentResolver.addAll(callExpressionScopeResolver);

parameterResolver.addAll(methodResolver);
parameterResolver.addAll(evaluation.callieResolver);
parameterResolver.addAll(callExpressionScopeResolver);

applyAssignHint(argumentResolver, parameterResolver);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ class MonomorphTest {
// Wrong already morphed to Map<String, Int>
mapDelayed.set(<error descr="Type mismatch (Expected: 'String' got: 'Int')">1</error>, <error descr="Type mismatch (Expected: 'Int' got: 'String')">"test"</error>);

// verify we are using callies typeParameter for typeParameter not specified in call expression
var returnValue:Int = mapDelayed.get("1"); // correct
var <error descr="Incompatible type: Null<Int> should be String">returnValue:String = mapDelayed.get("1")</error>;// wrong

var mapDelayed2 = new Map();
mapDelayed2.clear();// verify that accessing member without type parameter(s) wont affect monomorph
mapDelayed2.set("test", 1);
Expand Down

0 comments on commit 952440d

Please sign in to comment.