@@ -2221,6 +2221,7 @@ def type_compare_SetType(expected_type, ctx, expr, expr_type, raise_error=True):
22212221SetType .type_compare = type_compare_SetType
22222222
22232223def type_compare_IterableType (expected_type , ctx , expr , expr_type , raise_error = True ):
2224+
22242225 if isinstance (expr_type , OptionType ):
22252226 return check_option_type (type_compare_IterableType , expected_type , ctx , expr , expr_type , raise_error )
22262227
@@ -2300,12 +2301,13 @@ def type_compare_TypeVariable(expected_type, ctx, expr, expr_type, raise_error=T
23002301 ctx .call_type_env [- 1 ][expected_type .var_name ] = expr_type
23012302 return True
23022303 else : # not a call variable
2303- if expected_type == expr_type :
2304- return True
2305- else :
2306- if raise_error :
2307- ctx .add_type_error (TypeComparisonError (ctx .function_def , expected_type , expr , expr_type , tr ("Type mismatch for parameter #{} in call, expecting {} found: {}" ).format (expected_type .var_name [1 :], expected_type , expr_type )))
2308- return False
2304+ # XXX: is it always safe to accept the comparison ?
2305+ # or an error should be returned
2306+ return True
2307+
2308+ # if raise_error:
2309+ # ctx.add_type_error(TypeComparisonError(ctx.function_def, expected_type, expr, expr_type, tr("Type mismatch for parameter #{} in call, expecting {} found: {}").format(expected_type.var_name[1:], expected_type, expr_type)))
2310+ # return False
23092311
23102312TypeVariable .type_compare = type_compare_TypeVariable
23112313
0 commit comments