소스 검색

Function matches now ignore if the function itself is optional

kindlich 5 년 전
부모
커밋
2e7929e302
No known key found for this signature in database
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3
    0
      Parser/src/main/java/org/openzen/zenscript/parser/expression/ParsedExpressionFunction.java

+ 3
- 0
Parser/src/main/java/org/openzen/zenscript/parser/expression/ParsedExpressionFunction.java 파일 보기

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

Loading…
취소
저장