Browse Source

Make Optional type validation use Equals instead of reference equals

Background: Not every storedType int is the same if they come from different modules or so?
kindlich 4 years ago
parent
commit
8624e28045
No known key found for this signature in database

+ 1
- 1
Validator/src/main/java/org/openzen/zenscript/validator/visitors/ValidationUtils.java View File

@@ -74,7 +74,7 @@ public class ValidationUtils {
74 74
 			
75 75
 			if (parameter.defaultValue != null) {
76 76
 				parameter.defaultValue.accept(new ExpressionValidator(target, new DefaultParameterValueExpressionScope(access)));
77
-				if (parameter.defaultValue.type != parameter.type) {
77
+				if (!parameter.defaultValue.type.equals(parameter.type)) {
78 78
 					target.logError(INVALID_TYPE, position, "default value does not match parameter type");
79 79
 				}
80 80
 			}

Loading…
Cancel
Save