Skip to content

Commit ba4cdf2

Browse files
committed
Fix false error for =~ operator
1 parent 0cc3897 commit ba4cdf2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/nextflow/script/control/TypeCheckingVisitorEx.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,7 @@ public void visitBinaryExpression(BinaryExpression node) {
915915

916916
// TODO: =~: (String, String) -> Matcher
917917
case Types.FIND_REGEX:
918-
resultType = TypesEx.isEqual(ClassHelper.STRING_TYPE, lhsType) && TypesEx.isEqual(ClassHelper.STRING_TYPE, rhsType) ? ClassHelper.Boolean_TYPE : null;
918+
resultType = TypesEx.isEqual(ClassHelper.STRING_TYPE, lhsType) && TypesEx.isEqual(ClassHelper.STRING_TYPE, rhsType) ? ClassHelper.dynamicType() : null;
919919
break;
920920

921921
case Types.MATCH_REGEX:

0 commit comments

Comments
 (0)