|
|
|
@ -22,6 +22,14 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
@@ -22,6 +22,14 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
|
|
|
|
|
{ |
|
|
|
|
public static class SwitchExpressions |
|
|
|
|
{ |
|
|
|
|
public class ImplicitlyCastToString |
|
|
|
|
{ |
|
|
|
|
public static implicit operator string(ImplicitlyCastToString val) |
|
|
|
|
{ |
|
|
|
|
return "foo"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public enum State |
|
|
|
|
{ |
|
|
|
|
False, |
|
|
|
@ -146,5 +154,16 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
@@ -146,5 +154,16 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
|
|
|
|
|
return "Default"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static string Issue2222() |
|
|
|
|
{ |
|
|
|
|
return (string)new ImplicitlyCastToString() switch |
|
|
|
|
{ |
|
|
|
|
"foo" => "foo", |
|
|
|
|
"bar" => "bar", |
|
|
|
|
"quux" => "quux", |
|
|
|
|
_ => "default", |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |