Describe the bug 🐞
When creating auto properties in regular classes (not descending from IReactiveObject or any other RxUI type), the RXUISG0016 analyzer flags a warning on the property suggesting it should be turned into a Reactive property. This makes no sense for normal classes...there is no reason for normal, non-observable, non-INPC classes to have Reactive logic in them.

Attempting to run the code fix action generates a nonsensical error message:
RXUISG0015: The field SKBitmapDrawOperation._bounds cannot be used to generate an reactive property, as its name or type would cause conflicts with other generated members

The error message seems incorrect. The error is due to the object not being IObservableObject (this method), which is obviously the case here.
Not to pile on issues, but the description of #66 and #70 suggest that it shouldn't even be running this analyzer for read-only properties (as they can never change to begin with). The changes in #70 made it ignore private-settable properties, not read-only properties.
Step to reproduce
- Install the
ReactiveUI.SourceGenerators package
- Write a simple class with a get-only property and that does not implement
IReactiveObject:
public class TestClass(int x)
{
public int Value { get; } = x;
}
- Observe that the
Value property is flagged with the RXUISG0016 warning
Reproduction repository
https://github.com/ArcanoxDragon/ReactiveUI_AnalyzerIssue_Reproduction
Expected behavior
The RXUISG0016 analyzer should not flag a warning on any properties if the containing class does not somehow implement IReactiveObject.
In addition, the error message shown when a [Reactive] attribute is used within a class that does not implement IReactiveObject should be more clear.
Also in addition, the RXUISG0016 analyzer should not flag a warning for any properties that are fully read-only (i.e. no set; accessor at all), even inside of IReactiveObject inheritors.
Screenshots 🖼️
No response
IDE
Visual Studio 2022
Operating system
Windows 11
Version
No response
Device
No response
ReactiveUI Version
ReactiveUI.SourceGenerators 2.1.1
Additional information ℹ️
No response
Describe the bug 🐞
When creating auto properties in regular classes (not descending from
IReactiveObjector any other RxUI type), the RXUISG0016 analyzer flags a warning on the property suggesting it should be turned into a Reactive property. This makes no sense for normal classes...there is no reason for normal, non-observable, non-INPC classes to have Reactive logic in them.Attempting to run the code fix action generates a nonsensical error message:
RXUISG0015: The field SKBitmapDrawOperation._bounds cannot be used to generate an reactive property, as its name or type would cause conflicts with other generated membersThe error message seems incorrect. The error is due to the object not being
IObservableObject(this method), which is obviously the case here.Not to pile on issues, but the description of #66 and #70 suggest that it shouldn't even be running this analyzer for read-only properties (as they can never change to begin with). The changes in #70 made it ignore private-settable properties, not read-only properties.
Step to reproduce
ReactiveUI.SourceGeneratorspackageIReactiveObject:Valueproperty is flagged with the RXUISG0016 warningReproduction repository
https://github.com/ArcanoxDragon/ReactiveUI_AnalyzerIssue_Reproduction
Expected behavior
The RXUISG0016 analyzer should not flag a warning on any properties if the containing class does not somehow implement
IReactiveObject.In addition, the error message shown when a
[Reactive]attribute is used within a class that does not implementIReactiveObjectshould be more clear.Also in addition, the RXUISG0016 analyzer should not flag a warning for any properties that are fully read-only (i.e. no
set;accessor at all), even inside ofIReactiveObjectinheritors.Screenshots 🖼️
No response
IDE
Visual Studio 2022
Operating system
Windows 11
Version
No response
Device
No response
ReactiveUI Version
ReactiveUI.SourceGenerators 2.1.1
Additional information ℹ️
No response