File tree Expand file tree Collapse file tree
de.peeeq.wurstscript/src/main/java/de/peeeq/wurstscript/translation/imtranslation Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -881,10 +881,14 @@ public void visit(ImAlloc alloc) {
881881
882882 @ Override
883883 public void visit (ImFunctionCall call ) {
884- boolean dependsOnTypeVariable = typeArgumentsContainTypeVariable (call .getTypeArguments ());
884+ // Empty arguments may be supplied implicitly by the enclosing generic receiver.
885+ // Only an explicit, already-concrete call is independent of the caller context.
886+ boolean dependsOnCaller = call .getTypeArguments ().isEmpty ()
887+ || typeArgumentsContainTypeVariable (call .getTypeArguments ());
885888 if (constructsClassOwningGenericGlobals (function , call )
886- || (dependsOnTypeVariable && (translator .isGenericNewMarker (call .getFunc ())
887- || functionNeedsSpecialization (call .getFunc (), visitedFunctions , visitedMethods )))) {
889+ || translator .isGenericNewMarker (call .getFunc ())
890+ || (dependsOnCaller
891+ && functionNeedsSpecialization (call .getFunc (), visitedFunctions , visitedMethods ))) {
888892 found [0 ] = true ;
889893 return ;
890894 }
@@ -893,7 +897,9 @@ public void visit(ImFunctionCall call) {
893897
894898 @ Override
895899 public void visit (ImMethodCall call ) {
896- if (typeArgumentsContainTypeVariable (call .getTypeArguments ())
900+ boolean dependsOnCaller = call .getTypeArguments ().isEmpty ()
901+ || typeArgumentsContainTypeVariable (call .getTypeArguments ());
902+ if (dependsOnCaller
897903 && methodNeedsSpecialization (call .getMethod (), visitedFunctions , visitedMethods )) {
898904 found [0 ] = true ;
899905 return ;
You can’t perform that action at this time.
0 commit comments