Skip to content

Commit f55b034

Browse files
committed
Fix unification of partially computed FunctionTypeSymbol.
1 parent f27e5e3 commit f55b034

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

Nitra/DotNetLang/Utils/TypeUnifier.n

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,18 @@ namespace DotNet
6565
else unless (RequireAll(f1.Parameters, f2.Parameters, ref updatedVariables))
6666
return false;
6767

68-
if (f1.IsReturnEvaluated && !f2.IsReturnEvaluated)
68+
def f1Eval = f1.IsReturnEvaluated;
69+
def f2Eval = f2.IsReturnEvaluated;
70+
71+
if (f1Eval && f2Eval)
72+
return ProvideImpl(f1.Return, f2.Return, ref updatedVariables);
73+
else if (!f1Eval && !f2Eval)
74+
return false;
75+
else if (!f2Eval)
6976
f2.Return = f1.Return;
70-
else if (!f1.IsReturnEvaluated && f2.IsReturnEvaluated)
71-
f1.Return = f2.Return;
7277
else
73-
return ProvideImpl(f1.Return, f2.Return, ref updatedVariables);
78+
f1.Return = f2.Return;
79+
7480
true
7581

7682
| _ => base.UnifyUnwraped(typeSymbol1, typeSymbol2, ref updatedVariables)

0 commit comments

Comments
 (0)