From 952440dae4c0ac88776cdef75caeda68fd9faefa Mon Sep 17 00:00:00 2001 From: m0rkeulv Date: Tue, 14 Jan 2025 21:46:09 +0100 Subject: [PATCH] making sure callies typeParameters are used when evaluating callExpression and the typeParameters are not provided from arguments or other input. --- .../evaluator/callexpression/HaxeCallExpressionContext.java | 1 + .../resources/testData/annotation.semantic/Monomorphism.hx | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/main/java/com/intellij/plugins/haxe/model/evaluator/callexpression/HaxeCallExpressionContext.java b/src/main/java/com/intellij/plugins/haxe/model/evaluator/callexpression/HaxeCallExpressionContext.java index 4904a22df..601a17d7d 100644 --- a/src/main/java/com/intellij/plugins/haxe/model/evaluator/callexpression/HaxeCallExpressionContext.java +++ b/src/main/java/com/intellij/plugins/haxe/model/evaluator/callexpression/HaxeCallExpressionContext.java @@ -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); diff --git a/src/test/resources/testData/annotation.semantic/Monomorphism.hx b/src/test/resources/testData/annotation.semantic/Monomorphism.hx index 99c5b4553..20347e290 100644 --- a/src/test/resources/testData/annotation.semantic/Monomorphism.hx +++ b/src/test/resources/testData/annotation.semantic/Monomorphism.hx @@ -35,6 +35,10 @@ class MonomorphTest { // Wrong already morphed to Map mapDelayed.set(1, "test"); + // verify we are using callies typeParameter for typeParameter not specified in call expression + var returnValue:Int = mapDelayed.get("1"); // correct + var returnValue:String = mapDelayed.get("1");// wrong + var mapDelayed2 = new Map(); mapDelayed2.clear();// verify that accessing member without type parameter(s) wont affect monomorph mapDelayed2.set("test", 1);