Roslyn allows additional *primary_constraints* when the notnull
primary constraint is used
#75892
Labels
Area-Compilers
Feature - Nullable Reference Types
Nullable Reference Types
Feature - Warning Waves
Warning Waves
Milestone
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: