Browse Source

Fix simple type patterns.

pull/2461/head
Siegfried Pammer 4 years ago
parent
commit
3f62216c85
  1. 7
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/PatternMatching.cs

7
ICSharpCode.Decompiler.Tests/TestCases/Pretty/PatternMatching.cs

@ -105,6 +105,10 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
} }
} }
#if ROSLYN3 || OPT
// Roslyn 2.x generates a complex infeasible path in debug builds, which RemoveInfeasiblePathTransform
// currently cannot handle. Because this would increase the complexity of that transform, we ignore
// this case.
public void TypePatternValueTypesWithShortcircuitOr2(object x) public void TypePatternValueTypesWithShortcircuitOr2(object x)
{ {
if (F() || !(x is int value)) if (F() || !(x is int value))
@ -116,6 +120,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
Console.WriteLine(value); Console.WriteLine(value);
} }
} }
#endif
public void TypePatternGenerics<T>(object x) public void TypePatternGenerics<T>(object x)
{ {
@ -196,7 +201,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
public static void NotTypePatternVariableUsedOutsideTrueBranch(object x) public static void NotTypePatternVariableUsedOutsideTrueBranch(object x)
{ {
var text = x as string; string text = x as string;
if (text != null && text.Length > 5) if (text != null && text.Length > 5)
{ {
Console.WriteLine("pattern matches"); Console.WriteLine("pattern matches");

Loading…
Cancel
Save