diff --git a/src/Polyfill/Nullability/NullabilityInfoContext.cs b/src/Polyfill/Nullability/NullabilityInfoContext.cs index 42b0ef0f..a2939cdb 100644 --- a/src/Polyfill/Nullability/NullabilityInfoContext.cs +++ b/src/Polyfill/Nullability/NullabilityInfoContext.cs @@ -223,6 +223,7 @@ public NullabilityInfo Create(PropertyInfo propertyInfo) if (setter != null) { var parameters = setter.GetParameters(); + CheckNullabilityAttributes(nullability, parameters[parameters.Length-1].GetCustomAttributesData()); } else diff --git a/src/Tests/NullabilitySync.cs b/src/Tests/NullabilitySync.cs index c7380ba9..ceab6b5a 100644 --- a/src/Tests/NullabilitySync.cs +++ b/src/Tests/NullabilitySync.cs @@ -27,13 +27,7 @@ public async Task Run() .Replace(".IsGenericMethodParameter", ".IsGenericMethodParameter()") .Replace("SR.NullabilityInfoContext_NotSupported", "\"NullabilityInfoContext is not supported\"") .Replace( - "CheckNullabilityAttributes(nullability, setter.GetParameters()[^1].GetCustomAttributesData());", - """ - var parameters = setter.GetParameters(); - CheckNullabilityAttributes(nullability, parameters[parameters.Length-1].GetCustomAttributesData()); - """) - .Replace( - "CheckNullabilityAttributes(nullability, setter.GetParameters()[^1].GetCustomAttributesData());", + "CheckNullabilityAttributes(nullability, setter.GetParametersAsSpan()[^1].GetCustomAttributesData());", """ var parameters = setter.GetParameters(); CheckNullabilityAttributes(nullability, parameters[parameters.Length-1].GetCustomAttributesData());