|
|
@ -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"); |
|
|
|