|
|
@ -110,12 +110,13 @@ namespace ICSharpCode.Decompiler |
|
|
|
readOnlyMethods = false; |
|
|
|
readOnlyMethods = false; |
|
|
|
asyncUsingAndForEachStatement = false; |
|
|
|
asyncUsingAndForEachStatement = false; |
|
|
|
asyncEnumerator = false; |
|
|
|
asyncEnumerator = false; |
|
|
|
|
|
|
|
staticLocalFunctions = false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public CSharp.LanguageVersion GetMinimumRequiredVersion() |
|
|
|
public CSharp.LanguageVersion GetMinimumRequiredVersion() |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (nullableReferenceTypes || readOnlyMethods || asyncEnumerator || asyncUsingAndForEachStatement) |
|
|
|
if (nullableReferenceTypes || readOnlyMethods || asyncEnumerator || asyncUsingAndForEachStatement || staticLocalFunctions) |
|
|
|
return CSharp.LanguageVersion.CSharp8_0; |
|
|
|
return CSharp.LanguageVersion.CSharp8_0; |
|
|
|
if (introduceUnmanagedConstraint || tupleComparisons || stackAllocInitializers) |
|
|
|
if (introduceUnmanagedConstraint || tupleComparisons || stackAllocInitializers) |
|
|
|
return CSharp.LanguageVersion.CSharp7_3; |
|
|
|
return CSharp.LanguageVersion.CSharp7_3; |
|
|
@ -1064,6 +1065,23 @@ namespace ICSharpCode.Decompiler |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool staticLocalFunctions = true; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Gets/Sets whether C# 8.0 static local functions should be transformed.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
[Category("C# 8.0 / VS 2019")] |
|
|
|
|
|
|
|
[Description("DecompilerSettings.IntroduceStaticLocalFunctions")] |
|
|
|
|
|
|
|
public bool StaticLocalFunctions { |
|
|
|
|
|
|
|
get { return staticLocalFunctions; } |
|
|
|
|
|
|
|
set { |
|
|
|
|
|
|
|
if (staticLocalFunctions != value) { |
|
|
|
|
|
|
|
staticLocalFunctions = value; |
|
|
|
|
|
|
|
OnPropertyChanged(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool nullableReferenceTypes = true; |
|
|
|
bool nullableReferenceTypes = true; |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|