@@ -92,6 +92,7 @@ public void SetLanguageVersion(CSharp.LanguageVersion languageVersion)
92
92
stringInterpolation = false ;
93
93
dictionaryInitializers = false ;
94
94
extensionMethodsInCollectionInitializers = false ;
95
+ useRefLocalsForAccurateOrderOfEvaluation = false ;
95
96
}
96
97
if ( languageVersion < CSharp . LanguageVersion . CSharp7 )
97
98
{
@@ -153,7 +154,7 @@ public CSharp.LanguageVersion GetMinimumRequiredVersion()
153
154
|| discards || localFunctions )
154
155
return CSharp . LanguageVersion . CSharp7 ;
155
156
if ( awaitInCatchFinally || useExpressionBodyForCalculatedGetterOnlyProperties || nullPropagation
156
- || stringInterpolation || dictionaryInitializers || extensionMethodsInCollectionInitializers )
157
+ || stringInterpolation || dictionaryInitializers || extensionMethodsInCollectionInitializers || useRefLocalsForAccurateOrderOfEvaluation )
157
158
return CSharp . LanguageVersion . CSharp6 ;
158
159
if ( asyncAwait )
159
160
return CSharp . LanguageVersion . CSharp5 ;
@@ -445,7 +446,7 @@ public bool LiftNullables {
445
446
/// Decompile C# 6 ?. and ?[] operators.
446
447
/// </summary>
447
448
[ Category ( "C# 6.0 / VS 2015" ) ]
448
- [ Description ( "DecompilerSettings.DecompileAndOperators " ) ]
449
+ [ Description ( "DecompilerSettings.NullPropagation " ) ]
449
450
public bool NullPropagation {
450
451
get { return nullPropagation ; }
451
452
set {
@@ -819,6 +820,25 @@ public bool ExtensionMethodsInCollectionInitializers {
819
820
}
820
821
}
821
822
823
+ bool useRefLocalsForAccurateOrderOfEvaluation = true ;
824
+
825
+ /// <summary>
826
+ /// Gets/Sets whether to use C# 6.0 Extension Add methods in collection initializers.
827
+ /// Only has an effect if ObjectOrCollectionInitializers is enabled.
828
+ /// </summary>
829
+ [ Category ( "C# 6.0 / VS 2015" ) ]
830
+ [ Description ( "DecompilerSettings.UseRefLocalsForAccurateOrderOfEvaluation" ) ]
831
+ public bool UseRefLocalsForAccurateOrderOfEvaluation {
832
+ get { return useRefLocalsForAccurateOrderOfEvaluation ; }
833
+ set {
834
+ if ( useRefLocalsForAccurateOrderOfEvaluation != value )
835
+ {
836
+ useRefLocalsForAccurateOrderOfEvaluation = value ;
837
+ OnPropertyChanged ( ) ;
838
+ }
839
+ }
840
+ }
841
+
822
842
bool refExtensionMethods = true ;
823
843
824
844
/// <summary>
0 commit comments