Pārlūkot izejas kodu

Function matches now ignore if the function itself is optional

kindlich 6 gadus atpakaļ
vecāks
revīzija
2e7929e302
Šim parakstam datu bāzē netika atrasta zināma atslēga

+ 3
- 0
Parser/src/main/java/org/openzen/zenscript/parser/expression/ParsedExpressionFunction.java Parādīt failu

100
 	
100
 	
101
 	@Override
101
 	@Override
102
 	public boolean isCompatibleWith(BaseScope scope, StoredType type) {
102
 	public boolean isCompatibleWith(BaseScope scope, StoredType type) {
103
+		if(type.isOptional())
104
+			type = type.withoutOptional();
105
+
103
 		if (type.type instanceof FunctionTypeID) {
106
 		if (type.type instanceof FunctionTypeID) {
104
 			FunctionHeader definedHeader = header.compile(scope);
107
 			FunctionHeader definedHeader = header.compile(scope);
105
 			FunctionTypeID targetFunction = (FunctionTypeID) type.type;
108
 			FunctionTypeID targetFunction = (FunctionTypeID) type.type;

Notiek ielāde…
Atcelt
Saglabāt