diff --git a/src/Compilers/CSharp/Portable/Symbols/AnonymousTypes/SynthesizedSymbols/AnonymousType.TypeParameterSymbol.cs b/src/Compilers/CSharp/Portable/Symbols/AnonymousTypes/SynthesizedSymbols/AnonymousType.TypeParameterSymbol.cs index 919d2dbc7aea2..e45e40df714a5 100644 --- a/src/Compilers/CSharp/Portable/Symbols/AnonymousTypes/SynthesizedSymbols/AnonymousType.TypeParameterSymbol.cs +++ b/src/Compilers/CSharp/Portable/Symbols/AnonymousTypes/SynthesizedSymbols/AnonymousType.TypeParameterSymbol.cs @@ -75,7 +75,7 @@ internal override bool? ReferenceTypeConstraintIsNullable public override bool HasNotNullConstraint => false; - internal override bool? IsNotNullableIfReferenceType => null; + internal override bool? IsNotNullable => null; public override bool HasValueTypeConstraint { diff --git a/src/Compilers/CSharp/Portable/Symbols/ConstraintsHelper.cs b/src/Compilers/CSharp/Portable/Symbols/ConstraintsHelper.cs index 53d97bbfab722..e0f4bf16e27ae 100644 --- a/src/Compilers/CSharp/Portable/Symbols/ConstraintsHelper.cs +++ b/src/Compilers/CSharp/Portable/Symbols/ConstraintsHelper.cs @@ -913,7 +913,7 @@ private static bool CheckConstraints( { if (!SatisfiesConstraintType(conversions.WithNullability(true), typeArgument, constraintType, ref useSiteDiagnostics) || (typeArgument.GetValueNullableAnnotation().IsAnnotated() && !typeArgument.Type.IsNonNullableValueType() && - TypeParameterSymbol.IsNotNullableIfReferenceTypeFromConstraintType(constraintType, out _) == true)) + TypeParameterSymbol.IsNotNullableFromConstraintType(constraintType, out _) == true)) { var diagnostic = new CSDiagnosticInfo(ErrorCode.WRN_NullabilityMismatchInTypeParameterConstraint, containingSymbol.ConstructedFrom(), constraintType, typeParameter, typeArgument); nullabilityDiagnosticsBuilderOpt.Add(new TypeParameterDiagnosticInfo(typeParameter, diagnostic)); diff --git a/src/Compilers/CSharp/Portable/Symbols/ErrorTypeSymbol.ErrorTypeParameterSymbol.cs b/src/Compilers/CSharp/Portable/Symbols/ErrorTypeSymbol.ErrorTypeParameterSymbol.cs index 6267853988921..608b36ad286b0 100644 --- a/src/Compilers/CSharp/Portable/Symbols/ErrorTypeSymbol.ErrorTypeParameterSymbol.cs +++ b/src/Compilers/CSharp/Portable/Symbols/ErrorTypeSymbol.ErrorTypeParameterSymbol.cs @@ -74,7 +74,7 @@ internal override bool? ReferenceTypeConstraintIsNullable public override bool HasNotNullConstraint => false; - internal override bool? IsNotNullableIfReferenceType => null; + internal override bool? IsNotNullable => null; public override bool HasValueTypeConstraint { diff --git a/src/Compilers/CSharp/Portable/Symbols/MemberSignatureComparer.cs b/src/Compilers/CSharp/Portable/Symbols/MemberSignatureComparer.cs index e8dc2066341a5..aaf0f09eb2629 100644 --- a/src/Compilers/CSharp/Portable/Symbols/MemberSignatureComparer.cs +++ b/src/Compilers/CSharp/Portable/Symbols/MemberSignatureComparer.cs @@ -599,10 +599,10 @@ public static bool HaveSameNullabilityInConstraints(TypeParameterSymbol typePara { if (!typeParameter1.IsValueType) { - bool? isNotNullableIfReferenceType1 = typeParameter1.IsNotNullableIfReferenceType; - bool? isNotNullableIfReferenceType2 = typeParameter2.IsNotNullableIfReferenceType; - if (isNotNullableIfReferenceType1.HasValue && isNotNullableIfReferenceType2.HasValue && - isNotNullableIfReferenceType1.GetValueOrDefault() != isNotNullableIfReferenceType2.GetValueOrDefault()) + bool? isNotNullable1 = typeParameter1.IsNotNullable; + bool? isNotNullable2 = typeParameter2.IsNotNullable; + if (isNotNullable1.HasValue && isNotNullable2.HasValue && + isNotNullable1.GetValueOrDefault() != isNotNullable2.GetValueOrDefault()) { return false; } diff --git a/src/Compilers/CSharp/Portable/Symbols/Metadata/PE/PETypeParameterSymbol.cs b/src/Compilers/CSharp/Portable/Symbols/Metadata/PE/PETypeParameterSymbol.cs index 1a080de799fa4..e8bc78b115f3f 100644 --- a/src/Compilers/CSharp/Portable/Symbols/Metadata/PE/PETypeParameterSymbol.cs +++ b/src/Compilers/CSharp/Portable/Symbols/Metadata/PE/PETypeParameterSymbol.cs @@ -197,7 +197,7 @@ private ImmutableArray GetDeclaredConstraintTypes(ConsList< inProgress = inProgress.Prepend(this); foreach (TypeWithAnnotations constraintType in symbolsBuilder) { - if (!ConstraintsHelper.IsObjectConstraintSignificant(IsNotNullableIfReferenceTypeFromConstraintType(constraintType, inProgress, out _), bestObjectConstraint)) + if (!ConstraintsHelper.IsObjectConstraintSignificant(IsNotNullableFromConstraintType(constraintType, inProgress, out _), bestObjectConstraint)) { bestObjectConstraint = default; break; @@ -277,28 +277,28 @@ private TypeWithAnnotations GetConstraintTypeOrDefault(PEModuleSymbol moduleSymb return type; } - private static bool? IsNotNullableIfReferenceTypeFromConstraintType(TypeWithAnnotations constraintType, ConsList inProgress, out bool isNonNullableValueType) + private static bool? IsNotNullableFromConstraintType(TypeWithAnnotations constraintType, ConsList inProgress, out bool isNonNullableValueType) { if (!(constraintType.Type is PETypeParameterSymbol typeParameter) || (object)typeParameter.ContainingSymbol != inProgress.Head.ContainingSymbol || typeParameter.GetConstraintHandleCollection().Count == 0) { - return IsNotNullableIfReferenceTypeFromConstraintType(constraintType, out isNonNullableValueType); + return IsNotNullableFromConstraintType(constraintType, out isNonNullableValueType); } - bool? isNotNullableIfReferenceType = typeParameter.CalculateIsNotNullableIfReferenceType(inProgress, out isNonNullableValueType); + bool? isNotNullable = typeParameter.CalculateIsNotNullable(inProgress, out isNonNullableValueType); if (isNonNullableValueType) { - Debug.Assert(isNotNullableIfReferenceType == true); + Debug.Assert(isNotNullable == true); return true; } - if (constraintType.NullableAnnotation.IsAnnotated() || isNotNullableIfReferenceType == false) + if (constraintType.NullableAnnotation.IsAnnotated() || isNotNullable == false) { return false; } - else if (constraintType.NullableAnnotation.IsOblivious() || isNotNullableIfReferenceType == null) + else if (constraintType.NullableAnnotation.IsOblivious() || isNotNullable == null) { return null; } @@ -306,7 +306,7 @@ private TypeWithAnnotations GetConstraintTypeOrDefault(PEModuleSymbol moduleSymb return true; } - private bool? CalculateIsNotNullableIfReferenceType(ConsList inProgress, out bool isNonNullableValueType) + private bool? CalculateIsNotNullable(ConsList inProgress, out bool isNonNullableValueType) { if (inProgress.ContainsReference(this)) { @@ -330,7 +330,7 @@ private TypeWithAnnotations GetConstraintTypeOrDefault(PEModuleSymbol moduleSymb return fromNonTypeConstraints; } - bool? fromTypes = IsNotNullableIfReferenceTypeFromConstraintTypes(constraintTypes, inProgress, out isNonNullableValueType); + bool? fromTypes = IsNotNullableFromConstraintTypes(constraintTypes, inProgress, out isNonNullableValueType); if (isNonNullableValueType) { @@ -348,7 +348,7 @@ private TypeWithAnnotations GetConstraintTypeOrDefault(PEModuleSymbol moduleSymb return fromNonTypeConstraints; } - private static bool? IsNotNullableIfReferenceTypeFromConstraintTypes(ImmutableArray constraintTypes, ConsList inProgress, out bool isNonNullableValueType) + private static bool? IsNotNullableFromConstraintTypes(ImmutableArray constraintTypes, ConsList inProgress, out bool isNonNullableValueType) { Debug.Assert(!constraintTypes.IsDefaultOrEmpty); @@ -356,7 +356,7 @@ private TypeWithAnnotations GetConstraintTypeOrDefault(PEModuleSymbol moduleSymb bool? result = false; foreach (TypeWithAnnotations constraintType in constraintTypes) { - bool? fromType = IsNotNullableIfReferenceTypeFromConstraintType(constraintType, inProgress, out isNonNullableValueType); + bool? fromType = IsNotNullableFromConstraintType(constraintType, inProgress, out isNonNullableValueType); if (isNonNullableValueType) { @@ -466,7 +466,7 @@ public override bool HasNotNullConstraint } } - internal override bool? IsNotNullableIfReferenceType + internal override bool? IsNotNullable { get { @@ -507,11 +507,11 @@ internal override bool? IsNotNullableIfReferenceType symbolsBuilder.Add(type); } - return IsNotNullableIfReferenceTypeFromConstraintTypes(symbolsBuilder.ToImmutableAndFree()); + return IsNotNullableFromConstraintTypes(symbolsBuilder.ToImmutableAndFree()); } } - return CalculateIsNotNullableIfReferenceType(); + return CalculateIsNotNullable(); } } diff --git a/src/Compilers/CSharp/Portable/Symbols/Retargeting/RetargetingTypeParameterSymbol.cs b/src/Compilers/CSharp/Portable/Symbols/Retargeting/RetargetingTypeParameterSymbol.cs index e6b5d4fcbc422..b02c62ffbc935 100644 --- a/src/Compilers/CSharp/Portable/Symbols/Retargeting/RetargetingTypeParameterSymbol.cs +++ b/src/Compilers/CSharp/Portable/Symbols/Retargeting/RetargetingTypeParameterSymbol.cs @@ -82,11 +82,11 @@ internal override ImmutableArray GetConstraintTypes(ConsLis return this.RetargetingTranslator.Retarget(_underlyingTypeParameter.GetConstraintTypes(inProgress)); } - internal override bool? IsNotNullableIfReferenceType + internal override bool? IsNotNullable { get { - return _underlyingTypeParameter.IsNotNullableIfReferenceType; + return _underlyingTypeParameter.IsNotNullable; } } diff --git a/src/Compilers/CSharp/Portable/Symbols/Source/CrefTypeParameterSymbol.cs b/src/Compilers/CSharp/Portable/Symbols/Source/CrefTypeParameterSymbol.cs index 5230631025e22..7d671aaf27151 100644 --- a/src/Compilers/CSharp/Portable/Symbols/Source/CrefTypeParameterSymbol.cs +++ b/src/Compilers/CSharp/Portable/Symbols/Source/CrefTypeParameterSymbol.cs @@ -137,7 +137,7 @@ internal override bool? ReferenceTypeConstraintIsNullable public override bool HasNotNullConstraint => false; - internal override bool? IsNotNullableIfReferenceType => null; + internal override bool? IsNotNullable => null; public override bool HasUnmanagedTypeConstraint { diff --git a/src/Compilers/CSharp/Portable/Symbols/Source/IndexedTypeParameterSymbol.cs b/src/Compilers/CSharp/Portable/Symbols/Source/IndexedTypeParameterSymbol.cs index b5ff74435d6b2..e2f4614ed9f04 100644 --- a/src/Compilers/CSharp/Portable/Symbols/Source/IndexedTypeParameterSymbol.cs +++ b/src/Compilers/CSharp/Portable/Symbols/Source/IndexedTypeParameterSymbol.cs @@ -133,7 +133,7 @@ internal override bool? ReferenceTypeConstraintIsNullable public override bool HasNotNullConstraint => false; - internal override bool? IsNotNullableIfReferenceType => null; + internal override bool? IsNotNullable => null; public override bool HasUnmanagedTypeConstraint { diff --git a/src/Compilers/CSharp/Portable/Symbols/Source/SourceTypeParameterSymbol.cs b/src/Compilers/CSharp/Portable/Symbols/Source/SourceTypeParameterSymbol.cs index 82450177fa878..fa975f0dd87b2 100644 --- a/src/Compilers/CSharp/Portable/Symbols/Source/SourceTypeParameterSymbol.cs +++ b/src/Compilers/CSharp/Portable/Symbols/Source/SourceTypeParameterSymbol.cs @@ -328,7 +328,7 @@ internal bool ConstraintsNeedNullableAttribute() return !this.HasReferenceTypeConstraint && !this.HasValueTypeConstraint && this.ConstraintTypesNoUseSiteDiagnostics.IsEmpty && - this.IsNotNullableIfReferenceType == false; + this.IsNotNullable == false; } private NamedTypeSymbol GetDefaultBaseType() @@ -414,7 +414,7 @@ private byte GetSynthesizedNullableAttributeValue() { return NullableAnnotationExtensions.NotAnnotatedAttributeValue; } - else if (!this.HasValueTypeConstraint && this.ConstraintTypesNoUseSiteDiagnostics.IsEmpty && this.IsNotNullableIfReferenceType == false) + else if (!this.HasValueTypeConstraint && this.ConstraintTypesNoUseSiteDiagnostics.IsEmpty && this.IsNotNullable == false) { return NullableAnnotationExtensions.AnnotatedAttributeValue; } @@ -531,7 +531,7 @@ public override bool HasNotNullConstraint } } - internal override bool? IsNotNullableIfReferenceType + internal override bool? IsNotNullable { get { @@ -540,7 +540,7 @@ internal override bool? IsNotNullableIfReferenceType return null; } - return CalculateIsNotNullableIfReferenceType(); + return CalculateIsNotNullable(); } } @@ -652,7 +652,7 @@ internal override bool? ReferenceTypeConstraintIsNullable } } - internal override bool? IsNotNullableIfReferenceType + internal override bool? IsNotNullable { get { @@ -661,7 +661,7 @@ internal override bool? IsNotNullableIfReferenceType return null; } - return CalculateIsNotNullableIfReferenceType(); + return CalculateIsNotNullable(); } } @@ -892,11 +892,11 @@ public override bool HasNotNullConstraint } } - internal override bool? IsNotNullableIfReferenceType + internal override bool? IsNotNullable { get { - return this.OverriddenTypeParameter?.IsNotNullableIfReferenceType; + return this.OverriddenTypeParameter?.IsNotNullable; } } diff --git a/src/Compilers/CSharp/Portable/Symbols/SubstitutedTypeParameterSymbol.cs b/src/Compilers/CSharp/Portable/Symbols/SubstitutedTypeParameterSymbol.cs index 6e70af594e8dd..f76a8c1a58453 100644 --- a/src/Compilers/CSharp/Portable/Symbols/SubstitutedTypeParameterSymbol.cs +++ b/src/Compilers/CSharp/Portable/Symbols/SubstitutedTypeParameterSymbol.cs @@ -131,7 +131,7 @@ internal override ImmutableArray GetConstraintTypes(ConsLis { foreach (TypeWithAnnotations constraintType in constraintTypes) { - if (!ConstraintsHelper.IsObjectConstraintSignificant(IsNotNullableIfReferenceTypeFromConstraintType(constraintType, out _), bestObjectConstraint)) + if (!ConstraintsHelper.IsObjectConstraintSignificant(IsNotNullableFromConstraintType(constraintType, out _), bestObjectConstraint)) { bestObjectConstraint = default; break; @@ -149,22 +149,22 @@ internal override ImmutableArray GetConstraintTypes(ConsLis return constraintTypes.ToImmutableAndFree(); } - internal override bool? IsNotNullableIfReferenceType + internal override bool? IsNotNullable { get { if (_underlyingTypeParameter.ConstraintTypesNoUseSiteDiagnostics.IsEmpty) { - return _underlyingTypeParameter.IsNotNullableIfReferenceType; + return _underlyingTypeParameter.IsNotNullable; } else if (!HasNotNullConstraint && !HasValueTypeConstraint && !HasReferenceTypeConstraint) { var constraintTypes = ArrayBuilder.GetInstance(); _map.SubstituteConstraintTypesDistinctWithoutModifiers(_underlyingTypeParameter, _underlyingTypeParameter.GetConstraintTypes(ConsList.Empty), constraintTypes, null); - return IsNotNullableIfReferenceTypeFromConstraintTypes(constraintTypes.ToImmutableAndFree()); + return IsNotNullableFromConstraintTypes(constraintTypes.ToImmutableAndFree()); } - return CalculateIsNotNullableIfReferenceType(); + return CalculateIsNotNullable(); } } diff --git a/src/Compilers/CSharp/Portable/Symbols/TypeParameterSymbol.cs b/src/Compilers/CSharp/Portable/Symbols/TypeParameterSymbol.cs index d8193de49275c..761e8abfc3de1 100644 --- a/src/Compilers/CSharp/Portable/Symbols/TypeParameterSymbol.cs +++ b/src/Compilers/CSharp/Portable/Symbols/TypeParameterSymbol.cs @@ -430,14 +430,14 @@ internal static bool IsReferenceTypeFromConstraintTypes(ImmutableArray constraintTypes) + internal static bool? IsNotNullableFromConstraintTypes(ImmutableArray constraintTypes) { Debug.Assert(!constraintTypes.IsDefaultOrEmpty); bool? result = false; foreach (TypeWithAnnotations constraintType in constraintTypes) { - bool? fromType = IsNotNullableIfReferenceTypeFromConstraintType(constraintType, out _); + bool? fromType = IsNotNullableFromConstraintType(constraintType, out _); if (fromType == true) { return true; @@ -451,7 +451,7 @@ internal static bool IsReferenceTypeFromConstraintTypes(ImmutableArray @@ -73,7 +73,7 @@ public static bool IsTypeParameterDisallowingAnnotation(this TypeSymbol type) /// public static bool IsPossiblyNullableReferenceTypeTypeParameter(this TypeSymbol type) { - return type is TypeParameterSymbol { IsValueType: false, IsNotNullableIfReferenceType: false }; + return type is TypeParameterSymbol { IsValueType: false, IsNotNullable: false }; } public static bool IsNonNullableValueType(this TypeSymbol typeArgument) diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs index 06a76077578fc..bc9039f53d8b4 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs @@ -69386,19 +69386,19 @@ void symbolValidator1(ModuleSymbol m) { var bf1 = (MethodSymbol)m.GlobalNamespace.GetMember("B.F1"); TypeParameterSymbol t11 = bf1.TypeParameters[0]; - Assert.True(t11.IsNotNullableIfReferenceType); + Assert.True(t11.IsNotNullable); var bf2 = (MethodSymbol)m.GlobalNamespace.GetMember("B.F2"); TypeParameterSymbol t22 = bf2.TypeParameters[0]; - Assert.False(t22.IsNotNullableIfReferenceType); + Assert.False(t22.IsNotNullable); var bf3 = (MethodSymbol)m.GlobalNamespace.GetMember("B.F3"); TypeParameterSymbol t33 = bf3.TypeParameters[0]; - Assert.False(t33.IsNotNullableIfReferenceType); + Assert.False(t33.IsNotNullable); var bf4 = (MethodSymbol)m.GlobalNamespace.GetMember("B.F4"); TypeParameterSymbol t44 = bf4.TypeParameters[0]; - Assert.True(t44.IsNotNullableIfReferenceType); + Assert.True(t44.IsNotNullable); } var comp2 = CreateCompilation(new[] { source1 }, options: WithNonNullTypesTrue()); @@ -69421,19 +69421,19 @@ void symbolValidator2(ModuleSymbol m) { var bf1 = (MethodSymbol)m.GlobalNamespace.GetMember("B.F1"); TypeParameterSymbol t11 = bf1.TypeParameters[0]; - Assert.Null(t11.IsNotNullableIfReferenceType); + Assert.Null(t11.IsNotNullable); var bf2 = (MethodSymbol)m.GlobalNamespace.GetMember("B.F2"); TypeParameterSymbol t22 = bf2.TypeParameters[0]; - Assert.False(t22.IsNotNullableIfReferenceType); + Assert.False(t22.IsNotNullable); var bf3 = (MethodSymbol)m.GlobalNamespace.GetMember("B.F3"); TypeParameterSymbol t33 = bf3.TypeParameters[0]; - Assert.False(t33.IsNotNullableIfReferenceType); + Assert.False(t33.IsNotNullable); var bf4 = (MethodSymbol)m.GlobalNamespace.GetMember("B.F4"); TypeParameterSymbol t44 = bf4.TypeParameters[0]; - Assert.Null(t44.IsNotNullableIfReferenceType); + Assert.Null(t44.IsNotNullable); } var comp4 = CreateCompilation(new[] { source1 }); @@ -69513,11 +69513,11 @@ void symbolValidator1(ModuleSymbol m) { var bf2 = (MethodSymbol)m.GlobalNamespace.GetMember("D.F2"); TypeParameterSymbol t222 = bf2.TypeParameters[0]; - Assert.True(t222.IsNotNullableIfReferenceType); + Assert.True(t222.IsNotNullable); var bf3 = (MethodSymbol)m.GlobalNamespace.GetMember("D.F3"); TypeParameterSymbol t333 = bf3.TypeParameters[0]; - Assert.True(t333.IsNotNullableIfReferenceType); + Assert.True(t333.IsNotNullable); } var comp2 = CreateCompilation(new[] { source1 }, options: WithNonNullTypesTrue()); @@ -69540,11 +69540,11 @@ void symbolValidator2(ModuleSymbol m) { var bf2 = (MethodSymbol)m.GlobalNamespace.GetMember("D.F2"); TypeParameterSymbol t222 = bf2.TypeParameters[0]; - Assert.Null(t222.IsNotNullableIfReferenceType); + Assert.Null(t222.IsNotNullable); var bf3 = (MethodSymbol)m.GlobalNamespace.GetMember("D.F3"); TypeParameterSymbol t333 = bf3.TypeParameters[0]; - Assert.Null(t333.IsNotNullableIfReferenceType); + Assert.Null(t333.IsNotNullable); } var comp4 = CreateCompilation(new[] { source1 }); @@ -69586,7 +69586,7 @@ void symbolValidator(ModuleSymbol m) Assert.Equal("void B.F1() where T1 : notnull", f1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol t1 = f1.TypeParameters[0]; Assert.False(t1.IsReferenceType); - Assert.True(t1.IsNotNullableIfReferenceType); + Assert.True(t1.IsNotNullable); var attributes = t1.GetAttributes(); if (isSource) @@ -69625,7 +69625,7 @@ void symbolValidator(ModuleSymbol m) TypeParameterSymbol t1 = f1.TypeParameters[0]; Assert.False(t1.IsReferenceType); Assert.True(t1.HasNotNullConstraint); - Assert.True(t1.IsNotNullableIfReferenceType); + Assert.True(t1.IsNotNullable); var attributes = t1.GetAttributes(); if (isSource) @@ -69676,14 +69676,14 @@ public static void F2(T2? t2) where T2 : System.Object? Assert.Equal("void B.F1(T1? t1)", f1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol t1 = f1.TypeParameters[0]; Assert.False(t1.IsReferenceType); - Assert.False(t1.IsNotNullableIfReferenceType); + Assert.False(t1.IsNotNullable); Assert.Empty(t1.GetAttributes()); var f2 = (MethodSymbol)m.GlobalNamespace.GetMember("B.F2"); Assert.Equal("void B.F2(T2? t2)", f2.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol t2 = f2.TypeParameters[0]; Assert.False(t2.IsReferenceType); - Assert.False(t2.IsNotNullableIfReferenceType); + Assert.False(t2.IsNotNullable); Assert.Empty(t2.GetAttributes()); } @@ -69715,7 +69715,7 @@ public static void F1() where T1 : notnull Assert.Equal("void B.F1() where T1 : notnull", f1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol t1 = f1.TypeParameters[0]; Assert.False(t1.IsReferenceType); - Assert.True(t1.IsNotNullableIfReferenceType); + Assert.True(t1.IsNotNullable); Assert.Empty(t1.GetAttributes()); } @@ -69735,7 +69735,7 @@ public static void F1() where T1 : notnull Assert.Equal("void B.F1() where T1 : notnull", f1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol t1 = f1.TypeParameters[0]; Assert.False(t1.IsReferenceType); - Assert.True(t1.IsNotNullableIfReferenceType); + Assert.True(t1.IsNotNullable); Assert.Empty(t1.GetAttributes()); } } @@ -69791,7 +69791,7 @@ public static void F2(T2? t2) where T2 : notnull, struct TypeParameterSymbol t1 = f1.TypeParameters[0]; Assert.True(t1.IsValueType); Assert.True(t1.HasNotNullConstraint); - Assert.True(t1.IsNotNullableIfReferenceType); + Assert.True(t1.IsNotNullable); Assert.Empty(t1.GetAttributes()); var f2 = (MethodSymbol)m.GlobalNamespace.GetMember("B.F2"); @@ -69799,7 +69799,7 @@ public static void F2(T2? t2) where T2 : notnull, struct TypeParameterSymbol t2 = f2.TypeParameters[0]; Assert.True(t2.IsValueType); Assert.True(t2.HasNotNullConstraint); - Assert.True(t2.IsNotNullableIfReferenceType); + Assert.True(t2.IsNotNullable); Assert.Empty(t2.GetAttributes()); } @@ -69834,14 +69834,14 @@ public static void F2(T2? t2) where T2 : notnull, class Assert.Equal("void B.F1(T1? t1) where T1 : class!", f1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol t1 = f1.TypeParameters[0]; Assert.True(t1.IsReferenceType); - Assert.True(t1.IsNotNullableIfReferenceType); + Assert.True(t1.IsNotNullable); Assert.Empty(t1.GetAttributes()); var f2 = (MethodSymbol)m.GlobalNamespace.GetMember("B.F2"); Assert.Equal("void B.F2(T2? t2) where T2 : class!", f2.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol t2 = f2.TypeParameters[0]; Assert.True(t2.IsReferenceType); - Assert.True(t2.IsNotNullableIfReferenceType); + Assert.True(t2.IsNotNullable); Assert.Empty(t2.GetAttributes()); } @@ -69862,7 +69862,7 @@ public static void F2(T2? t2) where T2 : notnull, class? }"; var comp = CreateCompilation(new[] { source }, options: WithNonNullTypesTrue()); - Assert.True(((MethodSymbol)comp.SourceModule.GlobalNamespace.GetMember("B.F1")).TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(((MethodSymbol)comp.SourceModule.GlobalNamespace.GetMember("B.F1")).TypeParameters[0].IsNotNullable); comp.VerifyDiagnostics( // (4,58): error CS8713: The 'notnull' constraint must come before any other constraints @@ -69879,14 +69879,14 @@ public static void F2(T2? t2) where T2 : notnull, class? Assert.Equal("void B.F1(T1? t1) where T1 : class?", f1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol t1 = f1.TypeParameters[0]; Assert.True(t1.IsReferenceType); - Assert.True(t1.IsNotNullableIfReferenceType); + Assert.True(t1.IsNotNullable); Assert.Empty(t1.GetAttributes()); var f2 = (MethodSymbol)m.GlobalNamespace.GetMember("B.F2"); Assert.Equal("void B.F2(T2? t2) where T2 : class?", f2.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol t2 = f2.TypeParameters[0]; Assert.True(t2.IsReferenceType); - Assert.True(t2.IsNotNullableIfReferenceType); + Assert.True(t2.IsNotNullable); Assert.Empty(t2.GetAttributes()); } @@ -69918,7 +69918,7 @@ public static void F1(T1? t1) where T1 : class?, B Assert.Equal("void B.F1(T1? t1) where T1 : class?", f1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol t1 = f1.TypeParameters[0]; Assert.True(t1.IsReferenceType); - Assert.False(t1.IsNotNullableIfReferenceType); + Assert.False(t1.IsNotNullable); } [Fact] @@ -69967,7 +69967,7 @@ void symbolValidator(ModuleSymbol m) TypeParameterSymbol at1 = af1.TypeParameters[0]; Assert.False(at1.IsReferenceType); - Assert.True(at1.IsNotNullableIfReferenceType); + Assert.True(at1.IsNotNullable); Assert.Empty(at1.GetAttributes()); if (isSource) @@ -69978,7 +69978,7 @@ void symbolValidator(ModuleSymbol m) { var impl = af1.ExplicitInterfaceImplementations.Single(); Assert.Equal("void I.F1(TF1 x)", impl.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.Null(impl.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.Null(impl.TypeParameters[0].IsNotNullable); } var bf1 = (MethodSymbol)m.GlobalNamespace.GetMember("B.I.F1"); @@ -69995,7 +69995,7 @@ void symbolValidator(ModuleSymbol m) TypeParameterSymbol tf1 = bf1.TypeParameters[0]; Assert.False(tf1.IsReferenceType); - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); if (isSource) { Assert.Empty(tf1.GetAttributes()); @@ -70008,7 +70008,7 @@ void symbolValidator(ModuleSymbol m) Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(2)", attributes[0].ToString()); var impl = bf1.ExplicitInterfaceImplementations.Single(); Assert.Equal("void I.F1(TF1 x)", impl.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.Null(impl.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.Null(impl.TypeParameters[0].IsNotNullable); } } } @@ -70059,7 +70059,7 @@ void symbolValidator(ModuleSymbol m) TypeParameterSymbol at1 = af1.TypeParameters[0]; Assert.True(at1.IsReferenceType); - Assert.True(at1.IsNotNullableIfReferenceType); + Assert.True(at1.IsNotNullable); Assert.Empty(at1.GetAttributes()); if (isSource) @@ -70085,7 +70085,7 @@ void symbolValidator(ModuleSymbol m) TypeParameterSymbol tf1 = bf1.TypeParameters[0]; Assert.True(tf1.IsReferenceType); - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); Assert.Empty(tf1.GetAttributes()); if (isSource) { @@ -70144,7 +70144,7 @@ void symbolValidator(ModuleSymbol m) TypeParameterSymbol at1 = af1.TypeParameters[0]; Assert.True(at1.IsReferenceType); - Assert.True(at1.IsNotNullableIfReferenceType); + Assert.True(at1.IsNotNullable); if (isSource) { @@ -70169,7 +70169,7 @@ void symbolValidator(ModuleSymbol m) TypeParameterSymbol tf1 = bf1.TypeParameters[0]; Assert.True(tf1.IsReferenceType); - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); if (isSource) { Assert.Equal("void I.F1(TF1 x) where TF1 : class?", bf1.ExplicitInterfaceImplementations.Single().ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); @@ -70205,7 +70205,7 @@ public static void F1(T1? t1) where T1 : B, notnull Assert.Equal("void B.F1(T1? t1) where T1 : notnull, B!", f1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol t1 = f1.TypeParameters[0]; Assert.True(t1.IsReferenceType); - Assert.True(t1.IsNotNullableIfReferenceType); + Assert.True(t1.IsNotNullable); } [Fact] @@ -70230,7 +70230,7 @@ void symbolValidator(ModuleSymbol m) TypeParameterSymbol t1 = f1.TypeParameters[0]; Assert.True(t1.IsReferenceType); Assert.True(t1.HasNotNullConstraint); - Assert.True(t1.IsNotNullableIfReferenceType); + Assert.True(t1.IsNotNullable); } } @@ -70254,7 +70254,7 @@ public static void F1(T1? t1) where T1 : notnull, B Assert.Equal("void B.F1(T1? t1) where T1 : notnull, B!", f1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol t1 = f1.TypeParameters[0]; Assert.True(t1.IsReferenceType); - Assert.True(t1.IsNotNullableIfReferenceType); + Assert.True(t1.IsNotNullable); } [Fact] @@ -70281,7 +70281,7 @@ public static void F1(T1? t1) where T1 : object?, B Assert.Equal("void B.F1(T1? t1) where T1 : B!", f1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol t1 = f1.TypeParameters[0]; Assert.True(t1.IsReferenceType); - Assert.True(t1.IsNotNullableIfReferenceType); + Assert.True(t1.IsNotNullable); } [Fact] @@ -70330,7 +70330,7 @@ void symbolValidator(ModuleSymbol m) TypeParameterSymbol at1 = af1.TypeParameters[0]; Assert.True(at1.IsReferenceType); - Assert.True(at1.IsNotNullableIfReferenceType); + Assert.True(at1.IsNotNullable); if (isSource) { @@ -70355,7 +70355,7 @@ void symbolValidator(ModuleSymbol m) TypeParameterSymbol tf1 = bf1.TypeParameters[0]; Assert.True(tf1.IsReferenceType); - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); if (isSource) { Assert.Equal("void I.F1(TF1 x) where TF1 : B?", bf1.ExplicitInterfaceImplementations.Single().ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); @@ -70412,7 +70412,7 @@ void symbolValidator(ModuleSymbol m) TypeParameterSymbol at1 = af1.TypeParameters[0]; Assert.True(at1.IsReferenceType); - Assert.True(at1.IsNotNullableIfReferenceType); + Assert.True(at1.IsNotNullable); if (isSource) { @@ -70437,7 +70437,7 @@ void symbolValidator(ModuleSymbol m) TypeParameterSymbol tf1 = bf1.TypeParameters[0]; Assert.True(tf1.IsReferenceType); - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); if (isSource) { Assert.Equal("void I.F1(TF1 x) where TF1 : B?", bf1.ExplicitInterfaceImplementations.Single().ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); @@ -71213,7 +71213,7 @@ void symbolValidator1(ModuleSymbol m) Assert.Equal("void I1.F1()", f1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol tf1 = f1.TypeParameters[0]; - Assert.Null(tf1.IsNotNullableIfReferenceType); + Assert.Null(tf1.IsNotNullable); Assert.Empty(tf1.GetAttributes()); } @@ -71237,7 +71237,7 @@ void symbolValidator2(ModuleSymbol m) foreach (TypeParameterSymbol tf1 in f1.TypeParameters) { - Assert.Null(tf1.IsNotNullableIfReferenceType); + Assert.Null(tf1.IsNotNullable); Assert.Empty(tf1.GetAttributes()); } } @@ -71265,7 +71265,7 @@ void symbolValidator(ModuleSymbol m) Assert.Equal("void I1.F1() where TF1 : new()", f1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol tf1 = f1.TypeParameters[0]; - Assert.Null(tf1.IsNotNullableIfReferenceType); + Assert.Null(tf1.IsNotNullable); Assert.Empty(tf1.GetAttributes()); } } @@ -71292,7 +71292,7 @@ void symbolValidator(ModuleSymbol m) Assert.Equal("void I1.F1() where TF1 : class", f1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol tf1 = f1.TypeParameters[0]; - Assert.Null(tf1.IsNotNullableIfReferenceType); + Assert.Null(tf1.IsNotNullable); Assert.Empty(tf1.GetAttributes()); } } @@ -71319,7 +71319,7 @@ void symbolValidator(ModuleSymbol m) Assert.Equal("void I1.F1() where TF1 : struct", f1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol tf1 = f1.TypeParameters[0]; - Assert.True(tf1.IsNotNullableIfReferenceType); + Assert.True(tf1.IsNotNullable); Assert.Empty(tf1.GetAttributes()); } } @@ -71346,7 +71346,7 @@ void symbolValidator(ModuleSymbol m) Assert.Equal("void I1.F1() where TF1 : unmanaged", f1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol tf1 = f1.TypeParameters[0]; - Assert.True(tf1.IsNotNullableIfReferenceType); + Assert.True(tf1.IsNotNullable); Assert.Empty(tf1.GetAttributes()); } } @@ -71373,7 +71373,7 @@ void symbolValidator(ModuleSymbol m) Assert.Equal("void I1.F1() where TF1 : I1", f1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol tf1 = f1.TypeParameters[0]; - Assert.Null(tf1.IsNotNullableIfReferenceType); + Assert.Null(tf1.IsNotNullable); Assert.Empty(tf1.GetAttributes()); } } @@ -71406,7 +71406,7 @@ void symbolValidator(ModuleSymbol m) Assert.Equal("void I1.F1() where TF1 : class?", f1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol tf1 = f1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); var attributes = tf1.GetAttributes(); if (isSource) @@ -71447,7 +71447,7 @@ void symbolValidator(ModuleSymbol m) Assert.Equal("void I1.F1() where TF1 : I1?", f1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol tf1 = f1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); Assert.Empty(tf1.GetAttributes()); } } @@ -71476,7 +71476,7 @@ void symbolValidator1(ModuleSymbol m) Assert.Equal("void I1.F1()", f1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol tf1 = f1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); var attributes = tf1.GetAttributes(); if (isSource) @@ -71512,7 +71512,7 @@ void symbolValidator2(ModuleSymbol m) foreach (TypeParameterSymbol tf1 in f1.TypeParameters) { - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); var attributes = tf1.GetAttributes(); if (isSource) @@ -71552,7 +71552,7 @@ void symbolValidator(ModuleSymbol m) Assert.Equal("void I1.F1() where TF1 : new()", f1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol tf1 = f1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); var attributes = tf1.GetAttributes(); if (isSource) @@ -71591,7 +71591,7 @@ void symbolValidator(ModuleSymbol m) Assert.Equal("void I1.F1() where TF1 : class!", f1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol tf1 = f1.TypeParameters[0]; - Assert.True(tf1.IsNotNullableIfReferenceType); + Assert.True(tf1.IsNotNullable); var attributes = tf1.GetAttributes(); if (isSource) @@ -71628,7 +71628,7 @@ void symbolValidator(ModuleSymbol m) Assert.Equal("void I1.F1() where TF1 : struct", f1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol tf1 = f1.TypeParameters[0]; - Assert.True(tf1.IsNotNullableIfReferenceType); + Assert.True(tf1.IsNotNullable); var attributes = tf1.GetAttributes(); Assert.Empty(attributes); } @@ -71656,7 +71656,7 @@ void symbolValidator(ModuleSymbol m) Assert.Equal("void I1.F1() where TF1 : unmanaged", f1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol tf1 = f1.TypeParameters[0]; - Assert.True(tf1.IsNotNullableIfReferenceType); + Assert.True(tf1.IsNotNullable); var attributes = tf1.GetAttributes(); Assert.Empty(attributes); } @@ -71684,7 +71684,7 @@ void symbolValidator(ModuleSymbol m) Assert.Equal("void I1.F1() where TF1 : I1!", f1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol tf1 = f1.TypeParameters[0]; - Assert.True(tf1.IsNotNullableIfReferenceType); + Assert.True(tf1.IsNotNullable); var attributes = tf1.GetAttributes(); Assert.Empty(attributes); } @@ -71714,7 +71714,7 @@ void symbolValidator(ModuleSymbol m) Assert.Equal("void I1.F1() where TF1 : class?", f1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol tf1 = f1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); var attributes = tf1.GetAttributes(); if (isSource) @@ -71751,7 +71751,7 @@ void symbolValidator(ModuleSymbol m) Assert.Equal("void I1.F1() where TF1 : I1?", f1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol tf1 = f1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); var attributes = tf1.GetAttributes(); Assert.Empty(attributes); } @@ -71778,7 +71778,7 @@ void symbolValidator1(ModuleSymbol m) Assert.Equal("I1", i1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol tf1 = i1.TypeParameters[0]; - Assert.Null(tf1.IsNotNullableIfReferenceType); + Assert.Null(tf1.IsNotNullable); Assert.Empty(tf1.GetAttributes()); } @@ -71801,7 +71801,7 @@ void symbolValidator2(ModuleSymbol m) foreach (TypeParameterSymbol tf1 in i1.TypeParameters) { - Assert.Null(tf1.IsNotNullableIfReferenceType); + Assert.Null(tf1.IsNotNullable); Assert.Empty(tf1.GetAttributes()); } } @@ -71828,7 +71828,7 @@ void symbolValidator(ModuleSymbol m) Assert.Equal("I1 where TF1 : new()", i1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol tf1 = i1.TypeParameters[0]; - Assert.Null(tf1.IsNotNullableIfReferenceType); + Assert.Null(tf1.IsNotNullable); Assert.Empty(tf1.GetAttributes()); } } @@ -71854,7 +71854,7 @@ void symbolValidator(ModuleSymbol m) Assert.Equal("I1 where TF1 : class", i1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol tf1 = i1.TypeParameters[0]; - Assert.Null(tf1.IsNotNullableIfReferenceType); + Assert.Null(tf1.IsNotNullable); Assert.Empty(tf1.GetAttributes()); } } @@ -71880,7 +71880,7 @@ void symbolValidator(ModuleSymbol m) Assert.Equal("I1 where TF1 : struct", i1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol tf1 = i1.TypeParameters[0]; - Assert.True(tf1.IsNotNullableIfReferenceType); + Assert.True(tf1.IsNotNullable); Assert.Empty(tf1.GetAttributes()); } } @@ -71906,7 +71906,7 @@ void symbolValidator(ModuleSymbol m) Assert.Equal("I1 where TF1 : unmanaged", i1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol tf1 = i1.TypeParameters[0]; - Assert.True(tf1.IsNotNullableIfReferenceType); + Assert.True(tf1.IsNotNullable); Assert.Empty(tf1.GetAttributes()); } } @@ -71932,7 +71932,7 @@ void symbolValidator(ModuleSymbol m) Assert.Equal("I1 where TF1 : I1", i1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol tf1 = i1.TypeParameters[0]; - Assert.Null(tf1.IsNotNullableIfReferenceType); + Assert.Null(tf1.IsNotNullable); Assert.Empty(tf1.GetAttributes()); } } @@ -71964,7 +71964,7 @@ void symbolValidator(ModuleSymbol m) Assert.Equal("I1 where TF1 : class?", i1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol tf1 = i1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); var attributes = tf1.GetAttributes(); if (isSource) @@ -72004,7 +72004,7 @@ void symbolValidator(ModuleSymbol m) Assert.Equal("I1 where TF1 : I1?", i1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol tf1 = i1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); Assert.Empty(tf1.GetAttributes()); } } @@ -72032,7 +72032,7 @@ void symbolValidator1(ModuleSymbol m) Assert.Equal("I1", i1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol tf1 = i1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); var attributes = tf1.GetAttributes(); if (isSource) @@ -72067,7 +72067,7 @@ void symbolValidator2(ModuleSymbol m) foreach (TypeParameterSymbol tf1 in i1.TypeParameters) { - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); var attributes = tf1.GetAttributes(); if (isSource) @@ -72106,7 +72106,7 @@ void symbolValidator(ModuleSymbol m) Assert.Equal("I1 where TF1 : new()", i1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol tf1 = i1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); var attributes = tf1.GetAttributes(); if (isSource) @@ -72144,7 +72144,7 @@ void symbolValidator(ModuleSymbol m) Assert.Equal("I1 where TF1 : class!", i1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol tf1 = i1.TypeParameters[0]; - Assert.True(tf1.IsNotNullableIfReferenceType); + Assert.True(tf1.IsNotNullable); var attributes = tf1.GetAttributes(); if (isSource) @@ -72180,7 +72180,7 @@ void symbolValidator(ModuleSymbol m) Assert.Equal("I1 where TF1 : struct", i1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol tf1 = i1.TypeParameters[0]; - Assert.True(tf1.IsNotNullableIfReferenceType); + Assert.True(tf1.IsNotNullable); var attributes = tf1.GetAttributes(); Assert.Empty(attributes); } @@ -72207,7 +72207,7 @@ void symbolValidator(ModuleSymbol m) Assert.Equal("I1 where TF1 : unmanaged", i1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol tf1 = i1.TypeParameters[0]; - Assert.True(tf1.IsNotNullableIfReferenceType); + Assert.True(tf1.IsNotNullable); var attributes = tf1.GetAttributes(); Assert.Empty(attributes); } @@ -72234,7 +72234,7 @@ void symbolValidator(ModuleSymbol m) Assert.Equal("I1 where TF1 : I1!", i1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol tf1 = i1.TypeParameters[0]; - Assert.True(tf1.IsNotNullableIfReferenceType); + Assert.True(tf1.IsNotNullable); var attributes = tf1.GetAttributes(); Assert.Empty(attributes); } @@ -72263,7 +72263,7 @@ void symbolValidator(ModuleSymbol m) Assert.Equal("I1 where TF1 : class?", i1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol tf1 = i1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); var attributes = tf1.GetAttributes(); if (isSource) @@ -72299,7 +72299,7 @@ void symbolValidator(ModuleSymbol m) Assert.Equal("I1 where TF1 : I1?", i1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol tf1 = i1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); var attributes = tf1.GetAttributes(); Assert.Empty(attributes); } @@ -72331,7 +72331,7 @@ void symbolValidator1(ModuleSymbol m) Assert.Equal("I1", i1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol tf1 = i1.TypeParameters[0]; - Assert.Null(tf1.IsNotNullableIfReferenceType); + Assert.Null(tf1.IsNotNullable); var attributes = tf1.GetAttributes(); Assert.Empty(attributes); } @@ -72364,7 +72364,7 @@ void symbolValidator1(ModuleSymbol m) Assert.Equal("I1", i1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol tf1 = i1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); var attributes = tf1.GetAttributes(); if (isSource) @@ -72408,7 +72408,7 @@ void symbolValidator1(ModuleSymbol m) Assert.Equal("I1", i1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol tf1 = i1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); var attributes = tf1.GetAttributes(); if (isSource) @@ -72453,7 +72453,7 @@ void symbolValidator1(ModuleSymbol m) Assert.Equal("I1", i1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); TypeParameterSymbol tf1 = i1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); var attributes = tf1.GetAttributes(); if (isSource) @@ -72489,7 +72489,7 @@ partial interface I1 where TF1 : notnull var i1 = comp1.GlobalNamespace.GetTypeMember("I1"); TypeParameterSymbol tf1 = i1.TypeParameters[0]; Assert.True(tf1.HasNotNullConstraint); - Assert.True(tf1.IsNotNullableIfReferenceType); + Assert.True(tf1.IsNotNullable); var source2 = @"#nullable disable @@ -72513,7 +72513,7 @@ partial interface I1 where TF1 : notnull i1 = comp2.GlobalNamespace.GetTypeMember("I1"); tf1 = i1.TypeParameters[0]; Assert.False(tf1.HasNotNullConstraint); - Assert.Null(tf1.IsNotNullableIfReferenceType); + Assert.Null(tf1.IsNotNullable); Assert.True(tf1.HasConstructorConstraint); var source3 = @@ -72538,7 +72538,7 @@ partial interface I1 where TF1 : notnull i1 = comp3.GlobalNamespace.GetTypeMember("I1"); tf1 = i1.TypeParameters[0]; Assert.True(tf1.HasNotNullConstraint); - Assert.True(tf1.IsNotNullableIfReferenceType); + Assert.True(tf1.IsNotNullable); Assert.True(tf1.HasConstructorConstraint); } @@ -72563,7 +72563,7 @@ partial interface I1 where TF1 : notnull var i1 = comp1.GlobalNamespace.GetTypeMember("I1"); TypeParameterSymbol tf1 = i1.TypeParameters[0]; Assert.True(tf1.HasNotNullConstraint); - Assert.True(tf1.IsNotNullableIfReferenceType); + Assert.True(tf1.IsNotNullable); var source2 = @" @@ -72587,7 +72587,7 @@ partial interface I1 where TF1 : notnull i1 = comp2.GlobalNamespace.GetTypeMember("I1"); tf1 = i1.TypeParameters[0]; Assert.False(tf1.HasNotNullConstraint); - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); Assert.True(tf1.HasConstructorConstraint); } @@ -72613,7 +72613,7 @@ partial interface I1 where TF1 : notnull var i1 = comp1.GlobalNamespace.GetTypeMember("I1"); TypeParameterSymbol tf1 = i1.TypeParameters[0]; - Assert.True(tf1.IsNotNullableIfReferenceType); + Assert.True(tf1.IsNotNullable); var source2 = @"#nullable disable @@ -72638,7 +72638,7 @@ partial interface I1 where TF1 : notnull i1 = comp2.GlobalNamespace.GetTypeMember("I1"); tf1 = i1.TypeParameters[0]; Assert.False(tf1.HasNotNullConstraint); - Assert.Null(tf1.IsNotNullableIfReferenceType); + Assert.Null(tf1.IsNotNullable); Assert.True(tf1.HasConstructorConstraint); var source3 = @@ -72665,7 +72665,7 @@ partial interface I1 where TF1 : notnull i1 = comp3.GlobalNamespace.GetTypeMember("I1"); tf1 = i1.TypeParameters[0]; Assert.True(tf1.HasNotNullConstraint); - Assert.True(tf1.IsNotNullableIfReferenceType); + Assert.True(tf1.IsNotNullable); Assert.True(tf1.HasConstructorConstraint); } @@ -72691,7 +72691,7 @@ partial interface I1 where TF1 : notnull var i1 = comp1.GlobalNamespace.GetTypeMember("I1"); TypeParameterSymbol tf1 = i1.TypeParameters[0]; - Assert.True(tf1.IsNotNullableIfReferenceType); + Assert.True(tf1.IsNotNullable); var source2 = @" @@ -72716,7 +72716,7 @@ partial interface I1 where TF1 : notnull i1 = comp2.GlobalNamespace.GetTypeMember("I1"); tf1 = i1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); Assert.True(tf1.HasConstructorConstraint); } @@ -72747,7 +72747,7 @@ partial interface I1 where TF1 : object? var i1 = comp1.GlobalNamespace.GetTypeMember("I1"); TypeParameterSymbol tf1 = i1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); var source2 = @"#nullable disable @@ -72773,7 +72773,7 @@ partial interface I1 where TF1 : object? i1 = comp2.GlobalNamespace.GetTypeMember("I1"); tf1 = i1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); Assert.True(tf1.HasConstructorConstraint); var source3 = @@ -72800,10 +72800,10 @@ partial interface I1 where TF1 : object? i1 = comp3.GlobalNamespace.GetTypeMember("I1"); tf1 = i1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); TypeParameterSymbol tf2 = i1.TypeParameters[1]; - Assert.Null(tf2.IsNotNullableIfReferenceType); + Assert.Null(tf2.IsNotNullable); Assert.True(tf2.HasConstructorConstraint); } @@ -72831,7 +72831,7 @@ partial interface I1 where TF1 : object? var i1 = comp1.GlobalNamespace.GetTypeMember("I1"); TypeParameterSymbol tf1 = i1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); var source2 = @" @@ -72854,7 +72854,7 @@ partial interface I1 where TF1 : object? i1 = comp2.GlobalNamespace.GetTypeMember("I1"); tf1 = i1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); Assert.True(tf1.HasConstructorConstraint); var source3 = @@ -72878,10 +72878,10 @@ partial interface I1 where TF1 : object? i1 = comp3.GlobalNamespace.GetTypeMember("I1"); tf1 = i1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); TypeParameterSymbol tf2 = i1.TypeParameters[1]; - Assert.False(tf2.IsNotNullableIfReferenceType); + Assert.False(tf2.IsNotNullable); Assert.True(tf2.HasConstructorConstraint); } @@ -72911,7 +72911,7 @@ partial interface I1 where TF1 : object? var i1 = comp1.GlobalNamespace.GetTypeMember("I1"); TypeParameterSymbol tf1 = i1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); var source2 = @"#nullable disable @@ -72935,7 +72935,7 @@ partial interface I1 where TF1 : object? i1 = comp2.GlobalNamespace.GetTypeMember("I1"); tf1 = i1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); Assert.True(tf1.HasConstructorConstraint); var source3 = @@ -72960,10 +72960,10 @@ partial interface I1 where TF1 : object? i1 = comp3.GlobalNamespace.GetTypeMember("I1"); tf1 = i1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); TypeParameterSymbol tf2 = i1.TypeParameters[1]; - Assert.False(tf2.IsNotNullableIfReferenceType); + Assert.False(tf2.IsNotNullable); Assert.True(tf2.HasConstructorConstraint); } @@ -72996,7 +72996,7 @@ partial interface I1 where TF1 : object? var i1 = comp1.GlobalNamespace.GetTypeMember("I1"); TypeParameterSymbol tf1 = i1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); var source2 = @" @@ -73023,7 +73023,7 @@ partial interface I1 where TF1 : object? i1 = comp2.GlobalNamespace.GetTypeMember("I1"); tf1 = i1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); Assert.True(tf1.HasConstructorConstraint); var source3 = @@ -73051,10 +73051,10 @@ partial interface I1 where TF1 : object? i1 = comp3.GlobalNamespace.GetTypeMember("I1"); tf1 = i1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); TypeParameterSymbol tf2 = i1.TypeParameters[1]; - Assert.False(tf2.IsNotNullableIfReferenceType); + Assert.False(tf2.IsNotNullable); Assert.True(tf2.HasConstructorConstraint); } @@ -73085,7 +73085,7 @@ partial interface I1 var i1 = comp1.GlobalNamespace.GetTypeMember("I1"); TypeParameterSymbol tf1 = i1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); var source2 = @"#nullable disable @@ -73111,7 +73111,7 @@ partial interface I1 i1 = comp2.GlobalNamespace.GetTypeMember("I1"); tf1 = i1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); Assert.True(tf1.HasConstructorConstraint); var source3 = @@ -73138,10 +73138,10 @@ partial interface I1 i1 = comp3.GlobalNamespace.GetTypeMember("I1"); tf1 = i1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); TypeParameterSymbol tf2 = i1.TypeParameters[1]; - Assert.Null(tf2.IsNotNullableIfReferenceType); + Assert.Null(tf2.IsNotNullable); Assert.True(tf2.HasConstructorConstraint); } @@ -73169,7 +73169,7 @@ partial interface I1 var i1 = comp1.GlobalNamespace.GetTypeMember("I1"); TypeParameterSymbol tf1 = i1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); var source2 = @" @@ -73192,7 +73192,7 @@ partial interface I1 i1 = comp2.GlobalNamespace.GetTypeMember("I1"); tf1 = i1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); Assert.True(tf1.HasConstructorConstraint); var source3 = @@ -73216,10 +73216,10 @@ partial interface I1 i1 = comp3.GlobalNamespace.GetTypeMember("I1"); tf1 = i1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); TypeParameterSymbol tf2 = i1.TypeParameters[1]; - Assert.False(tf2.IsNotNullableIfReferenceType); + Assert.False(tf2.IsNotNullable); Assert.True(tf2.HasConstructorConstraint); } @@ -73252,7 +73252,7 @@ partial interface I1 var i1 = comp1.GlobalNamespace.GetTypeMember("I1"); TypeParameterSymbol tf1 = i1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); var source2 = @"#nullable disable @@ -73279,7 +73279,7 @@ partial interface I1 i1 = comp2.GlobalNamespace.GetTypeMember("I1"); tf1 = i1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); Assert.True(tf1.HasConstructorConstraint); var source3 = @@ -73307,10 +73307,10 @@ partial interface I1 i1 = comp3.GlobalNamespace.GetTypeMember("I1"); tf1 = i1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); TypeParameterSymbol tf2 = i1.TypeParameters[1]; - Assert.False(tf2.IsNotNullableIfReferenceType); + Assert.False(tf2.IsNotNullable); Assert.True(tf2.HasConstructorConstraint); } @@ -73341,7 +73341,7 @@ partial interface I1 var i1 = comp1.GlobalNamespace.GetTypeMember("I1"); TypeParameterSymbol tf1 = i1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); var source2 = @" @@ -73366,7 +73366,7 @@ partial interface I1 i1 = comp2.GlobalNamespace.GetTypeMember("I1"); tf1 = i1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); Assert.True(tf1.HasConstructorConstraint); var source3 = @@ -73392,10 +73392,10 @@ partial interface I1 i1 = comp3.GlobalNamespace.GetTypeMember("I1"); tf1 = i1.TypeParameters[0]; - Assert.False(tf1.IsNotNullableIfReferenceType); + Assert.False(tf1.IsNotNullable); TypeParameterSymbol tf2 = i1.TypeParameters[1]; - Assert.False(tf2.IsNotNullableIfReferenceType); + Assert.False(tf2.IsNotNullable); Assert.True(tf2.HasConstructorConstraint); } @@ -73462,8 +73462,8 @@ partial void M1() comp1.VerifyDiagnostics(); var m1 = comp1.GlobalNamespace.GetMember("A.M1"); - Assert.Null(m1.TypeParameters[0].IsNotNullableIfReferenceType); - Assert.False(m1.PartialImplementationPart.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.Null(m1.TypeParameters[0].IsNotNullable); + Assert.False(m1.PartialImplementationPart.TypeParameters[0].IsNotNullable); var source2 = @" @@ -73484,8 +73484,8 @@ partial void M1() comp2.VerifyDiagnostics(); m1 = comp2.GlobalNamespace.GetMember("A.M1"); - Assert.Null(m1.TypeParameters[0].IsNotNullableIfReferenceType); - Assert.False(m1.PartialImplementationPart.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.Null(m1.TypeParameters[0].IsNotNullable); + Assert.False(m1.PartialImplementationPart.TypeParameters[0].IsNotNullable); } [Fact] @@ -73510,8 +73510,8 @@ partial void M1() comp1.VerifyDiagnostics(); var m1 = comp1.GlobalNamespace.GetMember("A.M1"); - Assert.False(m1.TypeParameters[0].IsNotNullableIfReferenceType); - Assert.Null(m1.PartialImplementationPart.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.False(m1.TypeParameters[0].IsNotNullable); + Assert.Null(m1.PartialImplementationPart.TypeParameters[0].IsNotNullable); var source2 = @"#nullable disable @@ -73531,8 +73531,8 @@ partial void M1() comp2.VerifyDiagnostics(); m1 = comp2.GlobalNamespace.GetMember("A.M1"); - Assert.False(m1.TypeParameters[0].IsNotNullableIfReferenceType); - Assert.Null(m1.PartialImplementationPart.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.False(m1.TypeParameters[0].IsNotNullable); + Assert.Null(m1.PartialImplementationPart.TypeParameters[0].IsNotNullable); } [Fact] @@ -73581,8 +73581,8 @@ partial void M1() where TF1 : notnull ); var m1 = comp1.GlobalNamespace.GetMember("A.M1"); - Assert.False(m1.TypeParameters[0].IsNotNullableIfReferenceType); - Assert.True(m1.PartialImplementationPart.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.False(m1.TypeParameters[0].IsNotNullable); + Assert.True(m1.PartialImplementationPart.TypeParameters[0].IsNotNullable); } [Fact] @@ -73607,8 +73607,8 @@ partial void M1() where TF1 : notnull comp1.VerifyDiagnostics(); var m1 = comp1.GlobalNamespace.GetMember("A.M1"); - Assert.Null(m1.TypeParameters[0].IsNotNullableIfReferenceType); - Assert.True(m1.PartialImplementationPart.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.Null(m1.TypeParameters[0].IsNotNullable); + Assert.True(m1.PartialImplementationPart.TypeParameters[0].IsNotNullable); } [Fact] @@ -73637,8 +73637,8 @@ partial void M1() where TF1 : notnull ); var m1 = comp1.GlobalNamespace.GetMember("A.M1"); - Assert.False(m1.TypeParameters[0].IsNotNullableIfReferenceType); - Assert.True(m1.PartialImplementationPart.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.False(m1.TypeParameters[0].IsNotNullable); + Assert.True(m1.PartialImplementationPart.TypeParameters[0].IsNotNullable); } [Fact] @@ -73669,8 +73669,8 @@ partial void M1() where TF1 : object? ); var m1 = comp1.GlobalNamespace.GetMember("A.M1"); - Assert.Null(m1.TypeParameters[0].IsNotNullableIfReferenceType); - Assert.False(m1.PartialImplementationPart.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.Null(m1.TypeParameters[0].IsNotNullable); + Assert.False(m1.PartialImplementationPart.TypeParameters[0].IsNotNullable); } [Fact] @@ -73724,8 +73724,8 @@ partial void M1() where TF1 : object? ); var m1 = comp1.GlobalNamespace.GetMember("A.M1"); - Assert.Null(m1.TypeParameters[0].IsNotNullableIfReferenceType); - Assert.False(m1.PartialImplementationPart.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.Null(m1.TypeParameters[0].IsNotNullable); + Assert.False(m1.PartialImplementationPart.TypeParameters[0].IsNotNullable); } [Fact] @@ -73819,8 +73819,8 @@ partial void M1() comp1.VerifyDiagnostics(); var m1 = comp1.GlobalNamespace.GetMember("A.M1"); - Assert.False(m1.TypeParameters[0].IsNotNullableIfReferenceType); - Assert.Null(m1.PartialImplementationPart.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.False(m1.TypeParameters[0].IsNotNullable); + Assert.Null(m1.PartialImplementationPart.TypeParameters[0].IsNotNullable); } [Fact] @@ -73846,8 +73846,8 @@ partial void M1() comp1.VerifyDiagnostics(); var m1 = comp1.GlobalNamespace.GetMember("A.M1"); - Assert.Null(m1.TypeParameters[0].IsNotNullableIfReferenceType); - Assert.False(m1.PartialImplementationPart.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.Null(m1.TypeParameters[0].IsNotNullable); + Assert.False(m1.PartialImplementationPart.TypeParameters[0].IsNotNullable); } [Fact] @@ -73896,8 +73896,8 @@ partial void M1() ); var m1 = comp1.GlobalNamespace.GetMember("A.M1"); - Assert.True(m1.TypeParameters[0].IsNotNullableIfReferenceType); - Assert.False(m1.PartialImplementationPart.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(m1.TypeParameters[0].IsNotNullable); + Assert.False(m1.PartialImplementationPart.TypeParameters[0].IsNotNullable); } [Fact] @@ -73922,8 +73922,8 @@ partial void M1() comp1.VerifyDiagnostics(); var m1 = comp1.GlobalNamespace.GetMember("A.M1"); - Assert.True(m1.TypeParameters[0].IsNotNullableIfReferenceType); - Assert.Null(m1.PartialImplementationPart.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(m1.TypeParameters[0].IsNotNullable); + Assert.Null(m1.PartialImplementationPart.TypeParameters[0].IsNotNullable); } [Fact] @@ -73953,8 +73953,8 @@ partial void M1() ); var m1 = comp1.GlobalNamespace.GetMember("A.M1"); - Assert.True(m1.TypeParameters[0].IsNotNullableIfReferenceType); - Assert.False(m1.PartialImplementationPart.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(m1.TypeParameters[0].IsNotNullable); + Assert.False(m1.PartialImplementationPart.TypeParameters[0].IsNotNullable); } [Fact] @@ -73985,8 +73985,8 @@ partial void M1() ); var m1 = comp1.GlobalNamespace.GetMember("A.M1"); - Assert.False(m1.TypeParameters[0].IsNotNullableIfReferenceType); - Assert.Null(m1.PartialImplementationPart.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.False(m1.TypeParameters[0].IsNotNullable); + Assert.Null(m1.PartialImplementationPart.TypeParameters[0].IsNotNullable); } [Fact] @@ -74039,8 +74039,8 @@ partial void M1() ); var m1 = comp1.GlobalNamespace.GetMember("A.M1"); - Assert.False(m1.TypeParameters[0].IsNotNullableIfReferenceType); - Assert.Null(m1.PartialImplementationPart.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.False(m1.TypeParameters[0].IsNotNullable); + Assert.Null(m1.PartialImplementationPart.TypeParameters[0].IsNotNullable); } [Fact] @@ -74383,11 +74383,11 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1() where S : System.Object!", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.True(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(m1.TypeParameters[0].IsNotNullable); var baseM1 = m1.OverriddenMethod; Assert.Equal("void Test1.M1() where S : System.Object!", baseM1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.True(baseM1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(baseM1.TypeParameters[0].IsNotNullable); } } @@ -74427,11 +74427,11 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1()", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.Null(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.Null(m1.TypeParameters[0].IsNotNullable); var baseM1 = m1.OverriddenMethod; Assert.Equal("void Test1.M1()", baseM1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.Null(baseM1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.Null(baseM1.TypeParameters[0].IsNotNullable); } } @@ -74476,11 +74476,11 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1() where S : Test1!", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.True(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(m1.TypeParameters[0].IsNotNullable); var baseM1 = m1.OverriddenMethod; Assert.Equal("void Test1!>.M1() where S : Test1!", baseM1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.True(baseM1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(baseM1.TypeParameters[0].IsNotNullable); } } @@ -74512,11 +74512,11 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S x) where S : System.Object!, I1?", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.True(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(m1.TypeParameters[0].IsNotNullable); var baseM1 = m1.OverriddenMethod; Assert.Equal("void Test1.M1(S x) where S : System.Object!, I1?", baseM1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.True(baseM1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(baseM1.TypeParameters[0].IsNotNullable); } } @@ -75443,7 +75443,7 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S x)", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.Null(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.Null(m1.TypeParameters[0].IsNotNullable); } } @@ -75474,7 +75474,7 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S x) where S : System.Object!", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.True(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(m1.TypeParameters[0].IsNotNullable); } } @@ -75505,7 +75505,7 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S x)", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.False(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.False(m1.TypeParameters[0].IsNotNullable); } } @@ -75537,7 +75537,7 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S x) where S : I1", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.Null(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.Null(m1.TypeParameters[0].IsNotNullable); } } @@ -75570,7 +75570,7 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S x) where S : System.Object, I1?", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.Null(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.Null(m1.TypeParameters[0].IsNotNullable); } } @@ -75603,7 +75603,7 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S x) where S : I1!", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.True(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(m1.TypeParameters[0].IsNotNullable); } } @@ -75635,7 +75635,7 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S x) where S : I1!", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.True(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(m1.TypeParameters[0].IsNotNullable); } } @@ -75667,7 +75667,7 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S x) where S : System.Object!, I1?", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.True(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(m1.TypeParameters[0].IsNotNullable); } } @@ -75700,7 +75700,7 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S x) where S : System.Object!, I1", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.True(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(m1.TypeParameters[0].IsNotNullable); } } @@ -75730,7 +75730,7 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S x) where S : class", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.Null(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.Null(m1.TypeParameters[0].IsNotNullable); } } @@ -75761,7 +75761,7 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S x) where S : class?, System.Object", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.Null(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.Null(m1.TypeParameters[0].IsNotNullable); } } @@ -75792,7 +75792,7 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S x) where S : class!", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.True(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(m1.TypeParameters[0].IsNotNullable); } } @@ -75824,7 +75824,7 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S! x) where S : class!", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.True(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(m1.TypeParameters[0].IsNotNullable); } } @@ -75856,7 +75856,7 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S! x) where S : class?, System.Object!", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.True(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(m1.TypeParameters[0].IsNotNullable); } } @@ -75889,7 +75889,7 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S! x) where S : class, System.Object!", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.True(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(m1.TypeParameters[0].IsNotNullable); } } @@ -75920,7 +75920,7 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S x) where S : notnull", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.True(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(m1.TypeParameters[0].IsNotNullable); } } @@ -75952,7 +75952,7 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S x) where S : notnull", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.True(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(m1.TypeParameters[0].IsNotNullable); } } @@ -75983,7 +75983,7 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S x) where S : struct", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.True(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(m1.TypeParameters[0].IsNotNullable); } } @@ -76015,7 +76015,7 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S x) where S : struct", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.True(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(m1.TypeParameters[0].IsNotNullable); } } @@ -76045,7 +76045,7 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S x) where S : System.Int32", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.True(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(m1.TypeParameters[0].IsNotNullable); } } @@ -76075,7 +76075,7 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S x) where S : System.Int32", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.True(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(m1.TypeParameters[0].IsNotNullable); } } @@ -76105,7 +76105,7 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S x) where S : System.Object, System.Int32?", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.Null(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.Null(m1.TypeParameters[0].IsNotNullable); } } @@ -76135,7 +76135,7 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S x) where S : System.Object!, System.Int32?", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.True(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(m1.TypeParameters[0].IsNotNullable); } } @@ -76325,43 +76325,43 @@ .maxstack 8 var m1 = (MethodSymbol)compilation.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S x)", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.Null(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.Null(m1.TypeParameters[0].IsNotNullable); var m2 = (MethodSymbol)compilation.GlobalNamespace.GetMember("Test2.M2"); Assert.Equal("void Test2.M2(S x) where S : I1", m2.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.Null(m2.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.Null(m2.TypeParameters[0].IsNotNullable); var m3 = (MethodSymbol)compilation.GlobalNamespace.GetMember("Test2.M3"); Assert.Equal("void Test2.M3(S x) where S : class", m3.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.Null(m3.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.Null(m3.TypeParameters[0].IsNotNullable); var m4 = (MethodSymbol)compilation.GlobalNamespace.GetMember("Test2.M4"); Assert.Equal("void Test2.M4(S x) where S : class?, System.Object", m4.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.Null(m4.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.Null(m4.TypeParameters[0].IsNotNullable); var m5 = (MethodSymbol)compilation.GlobalNamespace.GetMember("Test2.M5"); Assert.Equal("void Test2.M5(S x) where S : class!", m5.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.True(m5.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(m5.TypeParameters[0].IsNotNullable); var m6 = (MethodSymbol)compilation.GlobalNamespace.GetMember("Test2.M6"); Assert.Equal("void Test2.M6(S x) where S : notnull", m6.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.True(m6.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(m6.TypeParameters[0].IsNotNullable); var m7 = (MethodSymbol)compilation.GlobalNamespace.GetMember("Test2.M7"); Assert.Equal("void Test2.M7(S x)", m7.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.False(m7.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.False(m7.TypeParameters[0].IsNotNullable); var m8 = (MethodSymbol)compilation.GlobalNamespace.GetMember("Test2.M8"); Assert.Equal("void Test2.M8(S x) where S : struct", m8.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.True(m8.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(m8.TypeParameters[0].IsNotNullable); var m9 = (MethodSymbol)compilation.GlobalNamespace.GetMember("Test2.M9"); Assert.Equal("void Test2.M9(S x) where S : System.Int32", m9.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.True(m9.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(m9.TypeParameters[0].IsNotNullable); var m10 = (MethodSymbol)compilation.GlobalNamespace.GetMember("Test2.M10"); Assert.Equal("void Test2.M10(S x) where S : System.Object, System.Int32?", m10.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.Null(m10.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.Null(m10.TypeParameters[0].IsNotNullable); } [Fact] @@ -76396,7 +76396,7 @@ .maxstack 8 var m1 = (MethodSymbol)compilation.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S x) where S : System.Object", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.Null(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.Null(m1.TypeParameters[0].IsNotNullable); } [Fact] @@ -76431,7 +76431,7 @@ .maxstack 8 var m1 = (MethodSymbol)compilation.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S x) where S : System.Object, U", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.Null(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.Null(m1.TypeParameters[0].IsNotNullable); } [Fact] @@ -76462,7 +76462,7 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S x) where S : class?, System.Object", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.Null(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.Null(m1.TypeParameters[0].IsNotNullable); } } @@ -76499,7 +76499,7 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S x) where S : System.Object, I1?", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.Null(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.Null(m1.TypeParameters[0].IsNotNullable); } } @@ -76535,7 +76535,7 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S x) where S : System.Object, I1?", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.Null(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.Null(m1.TypeParameters[0].IsNotNullable); } } @@ -76572,7 +76572,7 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S x) where S : System.Object!, I1?", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.True(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(m1.TypeParameters[0].IsNotNullable); } } @@ -76608,7 +76608,7 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S x) where S : System.Object!, I1?", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.True(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(m1.TypeParameters[0].IsNotNullable); } } @@ -76646,11 +76646,11 @@ void symbolValidator(ModuleSymbol m) { var t2m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S x) where S : T", t2m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.Null(t2m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.Null(t2m1.TypeParameters[0].IsNotNullable); var t3m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test3.M1"); Assert.Equal("void Test3.M1(S x) where S : System.Object, Test3?", t3m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.Null(t3m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.Null(t3m1.TypeParameters[0].IsNotNullable); } } @@ -76693,7 +76693,7 @@ void symbolValidator(ModuleSymbol m) { var t3m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test3.M1"); Assert.Equal("void Test3.M1(S x) where S : System.Object, Test3?", t3m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.Null(t3m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.Null(t3m1.TypeParameters[0].IsNotNullable); } } @@ -76731,11 +76731,11 @@ void symbolValidator(ModuleSymbol m) { var t2m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S x) where S : T", t2m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.True(t2m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(t2m1.TypeParameters[0].IsNotNullable); var t3m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test3.M1"); Assert.Equal("void Test3.M1(S x) where S : System.Int32", t3m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.True(t3m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(t3m1.TypeParameters[0].IsNotNullable); } } @@ -76772,7 +76772,7 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S x) where S : I1?, System.String", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.Null(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.Null(m1.TypeParameters[0].IsNotNullable); } } @@ -76808,7 +76808,7 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S x) where S : I1?, System.String", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.Null(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.Null(m1.TypeParameters[0].IsNotNullable); } } @@ -76845,7 +76845,7 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S! x) where S : I1?, System.String!", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.True(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(m1.TypeParameters[0].IsNotNullable); } } @@ -76881,7 +76881,7 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S x) where S : I1?, System.String!", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.True(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(m1.TypeParameters[0].IsNotNullable); } } @@ -76917,7 +76917,7 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S x) where S : I1?, System.String?", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.False(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.False(m1.TypeParameters[0].IsNotNullable); } } @@ -76953,7 +76953,7 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S! x) where S : I1?, System.String!", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.True(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.True(m1.TypeParameters[0].IsNotNullable); } } @@ -76989,7 +76989,7 @@ void symbolValidator(ModuleSymbol m) { var m1 = (MethodSymbol)m.GlobalNamespace.GetMember("Test2.M1"); Assert.Equal("void Test2.M1(S x) where S : I1?, System.String", m1.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); - Assert.Null(m1.TypeParameters[0].IsNotNullableIfReferenceType); + Assert.Null(m1.TypeParameters[0].IsNotNullable); } } diff --git a/src/ExpressionEvaluator/CSharp/Source/ExpressionCompiler/Symbols/EETypeParameterSymbol.cs b/src/ExpressionEvaluator/CSharp/Source/ExpressionCompiler/Symbols/EETypeParameterSymbol.cs index 6aca7bec0f5ba..04cbded00783f 100644 --- a/src/ExpressionEvaluator/CSharp/Source/ExpressionCompiler/Symbols/EETypeParameterSymbol.cs +++ b/src/ExpressionEvaluator/CSharp/Source/ExpressionCompiler/Symbols/EETypeParameterSymbol.cs @@ -65,16 +65,16 @@ public override bool HasNotNullConstraint get { return _sourceTypeParameter.HasNotNullConstraint; } } - internal override bool? IsNotNullableIfReferenceType + internal override bool? IsNotNullable { get { if (_sourceTypeParameter.ConstraintTypesNoUseSiteDiagnostics.IsEmpty) { - return _sourceTypeParameter.IsNotNullableIfReferenceType; + return _sourceTypeParameter.IsNotNullable; } - return CalculateIsNotNullableIfReferenceType(); + return CalculateIsNotNullable(); } } diff --git a/src/ExpressionEvaluator/CSharp/Source/ExpressionCompiler/Symbols/SimpleTypeParameterSymbol.cs b/src/ExpressionEvaluator/CSharp/Source/ExpressionCompiler/Symbols/SimpleTypeParameterSymbol.cs index 85ebf593e3fde..9f3704fe17bfb 100644 --- a/src/ExpressionEvaluator/CSharp/Source/ExpressionCompiler/Symbols/SimpleTypeParameterSymbol.cs +++ b/src/ExpressionEvaluator/CSharp/Source/ExpressionCompiler/Symbols/SimpleTypeParameterSymbol.cs @@ -55,7 +55,7 @@ internal override bool? ReferenceTypeConstraintIsNullable public override bool HasNotNullConstraint => false; - internal override bool? IsNotNullableIfReferenceType => null; + internal override bool? IsNotNullable => null; public override bool HasValueTypeConstraint {