You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to 15.2.5 only one primary_constraint can be specified. The Nullable reference types specification - 9.0 classifies the notnull constraint as a primary constraint. Therefore, both the above declarations should be prohibited.
BillWagner
changed the title
Roslyn allows additional *primary_constraints* when the notnull primary constraing is used
Roslyn allows additional *primary_constraints* when the notnull primary constraint is used
Nov 13, 2024
Version Used:
C# 12 and C# 13, with LangVersion set from C# 8 through C# 13.
Use the following code:
See sharplab
Expected Behavior:
According to 15.2.5 only one primary_constraint can be specified. The Nullable reference types specification - 9.0 classifies the
notnull
constraint as a primary constraint. Therefore, both the above declarations should be prohibited.Actual Behavior:
Both declarations are allowed.
See dotnet/csharpstandard#1178 (comment)
The text was updated successfully, but these errors were encountered: