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
Copy file name to clipboardExpand all lines: components/DependencyPropertyGenerator/CommunityToolkit.DependencyPropertyGenerator.SourceGenerators/AnalyzerReleases.Shipped.md
Copy file name to clipboardExpand all lines: components/DependencyPropertyGenerator/CommunityToolkit.DependencyPropertyGenerator.SourceGenerators/Diagnostics/Analyzers/InvalidPropertyNullableAnnotationAnalyzer.cs
Copy file name to clipboardExpand all lines: components/DependencyPropertyGenerator/CommunityToolkit.DependencyPropertyGenerator.SourceGenerators/Diagnostics/DiagnosticDescriptors.cs
+26Lines changed: 26 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -324,4 +324,30 @@ internal static class DiagnosticDescriptors
324
324
isEnabledByDefault:true,
325
325
description:"Properties annotated with [GeneratedDependencyProperty] and setting 'PropertyType' must do so with a type that is compatible with the declared property type.",
/// <c>The property '{0}' is not annotated as nullable and is using [AllowNull], but neither of its accessors are null-resilient (at least one generated 'On___Get' or 'On___Set' method must be implemented with [NotNull] on the 'propertyValue' parameter, to ensure assigning null values does not break the nullable annotations on the property)</c>.
title:"Non-nullable dependency property using [AllowNull] incorrectly",
334
+
messageFormat:"The property '{0}' is not annotated as nullable and is using [AllowNull], but neither of its accessors are null-resilient (at least one generated 'On___Get' or 'On___Set' method must be implemented with [NotNull] on the 'propertyValue' parameter, to ensure assigning null values does not break the nullable annotations on the property)",
description:"Non-nullable properties annotated with [GeneratedDependencyProperty] using [AllowNull] should have at least one generated 'On___Get' or 'On___Set' method implemented as null-resilient (by adding [NotNull] on the 'propertyValue' parameter) to ensure assigning null values does not break the nullable annotations on the property.",
/// <c>The property '{0}' is annotated as nullable and is using [NotNull], but it's not guaranteeing that returned values will not be null (it must either make its 'get' accessor null-resilient, by implementing at least one generated 'On___Get' method with [NotNull] on the 'propertyValue' parameter, or it must either add [DisallowNull] or implement at least one generated 'On___Set' method with [NotNull], and also either mark the property as required, or ensure that its default value is not null)</c>.
title:"Nullable dependency property using [NotNull] incorrectly",
347
+
messageFormat:"The property '{0}' is annotated as nullable and is using [NotNull], but it's not guaranteeing that returned values will not be null (it must either make its 'get' accessor null-resilient, by implementing at least one generated 'On___Get' method with [NotNull] on the 'propertyValue' parameter, or it must either add [DisallowNull] or implement at least one generated 'On___Set' method with [NotNull], and also either mark the property as required, or ensure that its default value is not null)",
description:"Nullable properties annotated with [GeneratedDependencyProperty] using [NotNull] should make their 'get' accessors null-resilient, by implementing at least one generated 'On___Get' method with [NotNull] on the 'propertyValue' parameter, or they must either add [DisallowNull] or implement at least one generated 'On___Set' method with [NotNull], and also either be marked as required properties, or ensure that the default value is not null.",
0 commit comments