|
|
|
@ -104,6 +104,7 @@ namespace ICSharpCode.Decompiler
@@ -104,6 +104,7 @@ namespace ICSharpCode.Decompiler
|
|
|
|
|
introduceUnmanagedConstraint = false; |
|
|
|
|
stackAllocInitializers = false; |
|
|
|
|
tupleComparisons = false; |
|
|
|
|
patternBasedFixedStatement = false; |
|
|
|
|
} |
|
|
|
|
if (languageVersion < CSharp.LanguageVersion.CSharp8_0) { |
|
|
|
|
nullableReferenceTypes = false; |
|
|
|
@ -117,7 +118,7 @@ namespace ICSharpCode.Decompiler
@@ -117,7 +118,7 @@ namespace ICSharpCode.Decompiler
|
|
|
|
|
{ |
|
|
|
|
if (nullableReferenceTypes || readOnlyMethods || asyncEnumerator || asyncUsingAndForEachStatement) |
|
|
|
|
return CSharp.LanguageVersion.CSharp8_0; |
|
|
|
|
if (introduceUnmanagedConstraint || tupleComparisons || stackAllocInitializers) |
|
|
|
|
if (introduceUnmanagedConstraint || tupleComparisons || stackAllocInitializers || patternBasedFixedStatement) |
|
|
|
|
return CSharp.LanguageVersion.CSharp7_3; |
|
|
|
|
if (introduceRefModifiersOnStructs || introduceReadonlyAndInModifiers || nonTrailingNamedArguments || refExtensionMethods) |
|
|
|
|
return CSharp.LanguageVersion.CSharp7_2; |
|
|
|
@ -926,6 +927,23 @@ namespace ICSharpCode.Decompiler
@@ -926,6 +927,23 @@ namespace ICSharpCode.Decompiler
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool patternBasedFixedStatement = true; |
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets/Sets whether C# 7.3 pattern based fixed statement should be used.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Category("C# 7.3 / VS 2017.7")] |
|
|
|
|
[Description("DecompilerSettings.UsePatternBasedFixedStatement")] |
|
|
|
|
public bool PatternBasedFixedStatement { |
|
|
|
|
get { return patternBasedFixedStatement; } |
|
|
|
|
set { |
|
|
|
|
if (patternBasedFixedStatement != value) { |
|
|
|
|
patternBasedFixedStatement = value; |
|
|
|
|
OnPropertyChanged(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool tupleTypes = true; |
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|