Add an analyzer for [field: ObservableProperty] uses #734
Labels
analyzer 👓
A new analyzer being implemented or updated
feature request 📬
A request for new changes to improve functionality
mvvm-toolkit 🧰
Issues/PRs for the MVVM Toolkit
The
[ObservableProperty]
attribute is only valid on field declarations. Trying to use it on a backing field for a property will not cause errors, as the source generator will simply skip that syntax node, but it will produce no diagnostics to tell the users what's wrong. There should be a new diagnostic analyzer to produce the appropriate diagnostic in these cases.Example
Consider this snippet:
This should emit a diagnostic on that attribute use.
The text was updated successfully, but these errors were encountered: