We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 840e7a5 commit 31f5c95Copy full SHA for 31f5c95
CommunityToolkit.Mvvm.SourceGenerators/ComponentModel/ObservablePropertyGenerator.Execute.cs
@@ -97,6 +97,11 @@ public static PropertyInfo GetInfo(IFieldSymbol fieldSymbol, out ImmutableArray<
97
fieldSymbol.ContainingType,
98
fieldSymbol.Name,
99
validationAttributes.Count);
100
+
101
+ // Remove all validation attributes so that the generated code doesn't cause a build error about the
102
+ // "ValidateProperty" method not existing (as the type doesn't inherit from ObservableValidator). The
103
+ // compilation will still fail due to this diagnostics, but with just this easier to understand error.
104
+ validationAttributes.Clear();
105
}
106
107
diagnostics = builder.ToImmutable();
0 commit comments