Skip to content

Commit f3412f5

Browse files
committed
事实证明我的inline有点问题
1 parent d21a9d6 commit f3412f5

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

Cmc/Expr/LambdaExpression.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@ public LambdaExpression(
2626
[NotNull] StatementList body,
2727
// FEATURE #22
2828
[CanBeNull] IList<VariableDeclaration> parameterList = null,
29-
[CanBeNull] Type returnType = null) : base(metaData)
29+
[CanBeNull] Type returnType = null,
30+
[CanBeNull] ReturnLabelDeclaration endLabel = null) : base(metaData)
3031
{
3132
Body = body;
3233
DeclaredType = returnType;
3334
ParameterList = parameterList ?? new List<VariableDeclaration>(0);
34-
EndLabel = new ReturnLabelDeclaration(MetaData, "");
35+
EndLabel = endLabel ?? new ReturnLabelDeclaration(MetaData, "");
3536
}
3637

3738
public override void SurroundWith(Environment environment)

CmcTest/FunctionCallTests.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,11 @@ public static VariableDeclaration IdDeclaration() =>
117117
new List<Expression>(new[]
118118
{
119119
new VariableExpression(MetaData.Empty, "a")
120-
})))
120+
})),
121+
"inner")
121122
), returnType:
122-
new UnknownType(MetaData.Empty, "i8")),
123+
new UnknownType(MetaData.Empty, "i8"),
124+
endLabel: new ReturnLabelDeclaration(MetaData.Empty, "inner")),
123125
new List<Expression>()))),
124126
new List<VariableDeclaration>(new[]
125127
{
@@ -199,6 +201,7 @@ public void FuncCallTest5()
199201
var example = FuncCallAst5();
200202
example.SurroundWith(Environment.SolarSystem);
201203
example.PrintDumpInfo();
204+
Errors.PrintErrorInfo();
202205
Assert.IsTrue(0 == Errors.ErrList.Count);
203206
}
204207

@@ -209,6 +212,7 @@ public void FuncCallTest5KeelAll()
209212
var example = FuncCallAst5();
210213
example.SurroundWith(Environment.SolarSystem);
211214
example.PrintDumpInfo();
215+
Errors.PrintErrorInfo();
212216
Assert.IsTrue(0 == Errors.ErrList.Count);
213217
}
214218

0 commit comments

Comments
 (0)