未验证 提交 a06b2245 编写于 作者: H Huo Yaoyuan 提交者: GitHub

Use private protected setters in compilation options. (#49034)

上级 706a5301
...@@ -522,7 +522,7 @@ internal CSharpCompilationOptions WithCurrentLocalTime(DateTime value) ...@@ -522,7 +522,7 @@ internal CSharpCompilationOptions WithCurrentLocalTime(DateTime value)
return this; return this;
} }
return new CSharpCompilationOptions(this) { CurrentLocalTime_internal_protected_set = value }; return new CSharpCompilationOptions(this) { CurrentLocalTime = value };
} }
internal CSharpCompilationOptions WithDebugPlusMode(bool debugPlusMode) internal CSharpCompilationOptions WithDebugPlusMode(bool debugPlusMode)
...@@ -532,7 +532,7 @@ internal CSharpCompilationOptions WithDebugPlusMode(bool debugPlusMode) ...@@ -532,7 +532,7 @@ internal CSharpCompilationOptions WithDebugPlusMode(bool debugPlusMode)
return this; return this;
} }
return new CSharpCompilationOptions(this) { DebugPlusMode_internal_protected_set = debugPlusMode }; return new CSharpCompilationOptions(this) { DebugPlusMode = debugPlusMode };
} }
public new CSharpCompilationOptions WithMetadataImportOptions(MetadataImportOptions value) public new CSharpCompilationOptions WithMetadataImportOptions(MetadataImportOptions value)
...@@ -552,7 +552,7 @@ internal CSharpCompilationOptions WithReferencesSupersedeLowerVersions(bool valu ...@@ -552,7 +552,7 @@ internal CSharpCompilationOptions WithReferencesSupersedeLowerVersions(bool valu
return this; return this;
} }
return new CSharpCompilationOptions(this) { ReferencesSupersedeLowerVersions_internal_protected_set = value }; return new CSharpCompilationOptions(this) { ReferencesSupersedeLowerVersions = value };
} }
public new CSharpCompilationOptions WithXmlReferenceResolver(XmlReferenceResolver? resolver) public new CSharpCompilationOptions WithXmlReferenceResolver(XmlReferenceResolver? resolver)
......
...@@ -161,17 +161,12 @@ public abstract class CompilationOptions ...@@ -161,17 +161,12 @@ public abstract class CompilationOptions
/// Used for time-based version generation when <see cref="System.Reflection.AssemblyVersionAttribute"/> contains a wildcard. /// Used for time-based version generation when <see cref="System.Reflection.AssemblyVersionAttribute"/> contains a wildcard.
/// If equal to default(<see cref="DateTime"/>) the actual current local time will be used. /// If equal to default(<see cref="DateTime"/>) the actual current local time will be used.
/// </summary> /// </summary>
internal DateTime CurrentLocalTime { get; private set; } internal DateTime CurrentLocalTime { get; private protected set; }
internal DateTime CurrentLocalTime_internal_protected_set { set { CurrentLocalTime = value; } }
/// <summary> /// <summary>
/// Emit mode that favors debuggability. /// Emit mode that favors debuggability.
/// </summary> /// </summary>
internal bool DebugPlusMode { get; private set; } internal bool DebugPlusMode { get; private protected set; }
// TODO: change visibility of the DebugPlusMode setter to internal & protected
internal bool DebugPlusMode_internal_protected_set { set { DebugPlusMode = value; } }
/// <summary> /// <summary>
/// Specifies whether to import members with accessibility other than public or protected by default. /// Specifies whether to import members with accessibility other than public or protected by default.
...@@ -185,10 +180,7 @@ public abstract class CompilationOptions ...@@ -185,10 +180,7 @@ public abstract class CompilationOptions
/// <summary> /// <summary>
/// Apply additional disambiguation rules during resolution of referenced assemblies. /// Apply additional disambiguation rules during resolution of referenced assemblies.
/// </summary> /// </summary>
internal bool ReferencesSupersedeLowerVersions { get; private set; } internal bool ReferencesSupersedeLowerVersions { get; private protected set; }
// TODO: change visibility of the ReferencesSupersedeLowerVersions setter to internal & protected
internal bool ReferencesSupersedeLowerVersions_internal_protected_set { set { ReferencesSupersedeLowerVersions = value; } }
/// <summary> /// <summary>
/// Modifies the incoming diagnostic, for example escalating its severity, or discarding it (returning null) based on the compilation options. /// Modifies the incoming diagnostic, for example escalating its severity, or discarding it (returning null) based on the compilation options.
......
...@@ -672,7 +672,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic ...@@ -672,7 +672,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Return Me Return Me
End If End If
Return New VisualBasicCompilationOptions(Me) With {.CurrentLocalTime_internal_protected_set = value} Return New VisualBasicCompilationOptions(Me) With {.CurrentLocalTime = value}
End Function End Function
''' <summary> ''' <summary>
...@@ -685,7 +685,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic ...@@ -685,7 +685,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Return Me Return Me
End If End If
Return New VisualBasicCompilationOptions(Me) With {.DebugPlusMode_internal_protected_set = debugPlusMode} Return New VisualBasicCompilationOptions(Me) With {.DebugPlusMode = debugPlusMode}
End Function End Function
''' <summary> ''' <summary>
...@@ -910,7 +910,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic ...@@ -910,7 +910,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Return Me Return Me
End If End If
Return New VisualBasicCompilationOptions(Me) With {.ReferencesSupersedeLowerVersions_internal_protected_set = value} Return New VisualBasicCompilationOptions(Me) With {.ReferencesSupersedeLowerVersions = value}
End Function End Function
''' <summary> ''' <summary>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册