Browse Source

Fixed AIOOB when omitting an optional parameter

kindlich 5 years ago
parent
commit
ab202cfca6
No known key found for this signature in database

+ 1
- 1
CodeModel/src/main/java/org/openzen/zenscript/codemodel/FunctionHeader.java View File

234
 			return false;
234
 			return false;
235
 		
235
 		
236
 		FunctionHeader header = fillGenericArguments(position, scope, arguments.typeArguments);
236
 		FunctionHeader header = fillGenericArguments(position, scope, arguments.typeArguments);
237
-		for (int i = 0; i < header.parameters.length; i++) {
237
+		for (int i = 0; i < header.minParameters; i++) {
238
 			if (!arguments.arguments[i].type.equals(header.parameters[i].type))
238
 			if (!arguments.arguments[i].type.equals(header.parameters[i].type))
239
 				return false;
239
 				return false;
240
 		}
240
 		}

Loading…
Cancel
Save