Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relax ordering constraints around 'ref' and 'partial' modifiers #23533

Closed
wants to merge 13 commits into from
18 changes: 9 additions & 9 deletions src/Compilers/CSharp/Portable/CSharpResources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/Compilers/CSharp/Portable/CSharpResources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1089,9 +1089,6 @@
<data name="ERR_NoImplicitConvCast" xml:space="preserve">
<value>Cannot implicitly convert type '{0}' to '{1}'. An explicit conversion exists (are you missing a cast?)</value>
</data>
<data name="ERR_PartialMisplaced" xml:space="preserve">
<value>The 'partial' modifier can only appear immediately before 'class', 'struct', 'interface', or 'void'</value>
</data>
<data name="ERR_ImportedCircularBase" xml:space="preserve">
<value>Imported type '{0}' is invalid. It contains a circular base class dependency.</value>
</data>
Expand Down Expand Up @@ -5933,4 +5930,7 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ
<data name="ERR_InternalError" xml:space="preserve">
<value>Internal error in the C# compiler.</value>
</data>
<data name="IDS_FeatureRefPartialModOrdering" xml:space="preserve">
<value>ref and partial modifier ordering</value>
</data>
</root>
2 changes: 1 addition & 1 deletion src/Compilers/CSharp/Portable/Errors/ErrorCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ internal enum ErrorCode
ERR_PartialWrongTypeParams = 264,
ERR_PartialWrongConstraints = 265,
ERR_NoImplicitConvCast = 266, // Requires SymbolDistinguisher.
ERR_PartialMisplaced = 267,
// ERR_PartialMisplaced = 267, // We now give BadMemberFlag since the order is relaxed
ERR_ImportedCircularBase = 268,
ERR_UseDefViolationOut = 269,
ERR_ArraySizeInDeclaration = 270,
Expand Down
5 changes: 5 additions & 0 deletions src/Compilers/CSharp/Portable/Errors/MessageID.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ internal enum MessageID
IDS_OverrideWithConstraints = MessageBase + 12761,
IDS_FeatureNestedStackalloc = MessageBase + 12762,
IDS_FeatureSwitchExpression = MessageBase + 12763,

IDS_FeatureRefPartialModOrdering = MessageBase + 12764,
}

// Message IDs may refer to strings that need to be localized.
Expand Down Expand Up @@ -288,6 +290,9 @@ internal static LanguageVersion RequiredVersion(this MessageID feature)
// Checks are in the LanguageParser unless otherwise noted.
switch (feature)
{
case MessageID.IDS_FeatureRefPartialModOrdering:
return LanguageVersion.Preview;

// C# 8.0 features.
case MessageID.IDS_FeatureAltInterpolatedVerbatimStrings:
case MessageID.IDS_FeatureCoalesceAssignmentExpression:
Expand Down
Loading