diff --git a/ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs b/ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs index b300ae49a..dffc1d64d 100644 --- a/ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs +++ b/ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs @@ -486,7 +486,7 @@ namespace ICSharpCode.Decompiler.Tests [Test] public void Issue1080([ValueSource(nameof(roslynOnlyOptions))] CompilerOptions cscOptions) { - RunForLibrary(cscOptions: cscOptions); + RunForLibrary(cscOptions: cscOptions, decompilerSettings: new DecompilerSettings(CSharp.LanguageVersion.CSharp6)); } [Test] diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ShortCircuit.cs b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ShortCircuit.cs index f753d91c3..4e7f7e3b1 100644 --- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ShortCircuit.cs +++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ShortCircuit.cs @@ -320,15 +320,9 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty if (!F(1)) { } - if (F(2) && F(3)) - { - } if (F(4) || F(5)) { } - if (F(0) && F(1) && !F(2) && (F(3) || F(4))) - { - } E(); } #endif diff --git a/ICSharpCode.Decompiler/DecompilerSettings.cs b/ICSharpCode.Decompiler/DecompilerSettings.cs index 182b280d4..6f901f084 100644 --- a/ICSharpCode.Decompiler/DecompilerSettings.cs +++ b/ICSharpCode.Decompiler/DecompilerSettings.cs @@ -104,6 +104,7 @@ namespace ICSharpCode.Decompiler discards = false; localFunctions = false; deconstruction = false; + patternMatching = false; } if (languageVersion < CSharp.LanguageVersion.CSharp7_2) { @@ -157,7 +158,7 @@ namespace ICSharpCode.Decompiler return CSharp.LanguageVersion.CSharp7_2; // C# 7.1 missing if (outVariables || throwExpressions || tupleTypes || tupleConversions - || discards || localFunctions) + || discards || localFunctions || deconstruction || patternMatching) return CSharp.LanguageVersion.CSharp7; if (awaitInCatchFinally || useExpressionBodyForCalculatedGetterOnlyProperties || nullPropagation || stringInterpolation || dictionaryInitializers || extensionMethodsInCollectionInitializers