|
@@ -140,11 +140,14 @@ public class ParsedCallArguments {
|
140
|
140
|
List<StoredType>[] predictedTypes = new List[arguments.size()];
|
141
|
141
|
for (int i = 0; i < predictedTypes.length; i++)
|
142
|
142
|
predictedTypes[i] = new ArrayList<>();
|
143
|
|
-
|
|
143
|
+
|
144
|
144
|
for (FunctionHeader header : candidates) {
|
|
145
|
+ //TODO: this is wrong!
|
|
146
|
+ boolean variadic = header.isVariadic();
|
145
|
147
|
for (int i = 0; i < arguments.size(); i++) {
|
146
|
|
- if (!predictedTypes[i].contains(header.parameters[i].type))
|
147
|
|
- predictedTypes[i].add(header.parameters[i].type);
|
|
148
|
+ final StoredType parameterType = header.getParameterType(variadic, i);
|
|
149
|
+ if (!predictedTypes[i].contains(parameterType))
|
|
150
|
+ predictedTypes[i].add(parameterType);
|
148
|
151
|
}
|
149
|
152
|
}
|
150
|
153
|
|
|
@@ -223,8 +226,9 @@ public class ParsedCallArguments {
|
223
|
226
|
private boolean isCompatibleWith(BaseScope scope, FunctionHeader header, StoredType[] typeArguments) {
|
224
|
227
|
if (!header.accepts(arguments.size()))
|
225
|
228
|
return false;
|
226
|
|
-
|
227
|
|
- boolean variadic = false;
|
|
229
|
+
|
|
230
|
+ //TODO: This is wrong
|
|
231
|
+ boolean variadic = header.isVariadic();
|
228
|
232
|
for (int i = 0; i < arguments.size(); i++) {
|
229
|
233
|
FunctionParameter parameter = header.getParameter(variadic, i);
|
230
|
234
|
if (typeArguments == null && header.typeParameters != null && parameter.type.hasInferenceBlockingTypeParameters(header.typeParameters))
|