|
|
|
|
@ -123,7 +123,7 @@ namespace ICSharpCode.Decompiler.Ast
@@ -123,7 +123,7 @@ namespace ICSharpCode.Decompiler.Ast
|
|
|
|
|
SwitchStatement switchStmt = new SwitchStatement() { Expression = (Expression)TransformExpression(ilSwitch.Condition) }; |
|
|
|
|
foreach (var caseBlock in ilSwitch.CaseBlocks) { |
|
|
|
|
SwitchSection section = new SwitchSection(); |
|
|
|
|
section.CaseLabels.AddRange(caseBlock.Values.Select(i => new CaseLabel() { Expression = new PrimitiveExpression(i) })); |
|
|
|
|
section.CaseLabels.AddRange(caseBlock.Values.Select(i => new CaseLabel() { Expression = AstBuilder.MakePrimitive(i, ilSwitch.Condition.InferredType) })); |
|
|
|
|
section.Statements.Add(TransformBlock(caseBlock)); |
|
|
|
|
switchStmt.SwitchSections.Add(section); |
|
|
|
|
} |
|
|
|
|
|