-
-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Describe the bug 🐞
Adding a [Reactive] property to a class that implements IReactiveObject but does not inherit from ReactiveObject leads to a build error:
The field {MyField} cannot be used to generate an ReactiveUI property, as it is not part of a class that inherits from ReactiveObject
This happens because IsTargetTypeValid(propertySymbol) compares IReactiveObject to propertySymbol.ContainingType.BaseType instead of checking the implemented interfaces on propertySymbol.ContainingType.
Step to reproduce
- Create a MyReactiveBase class that implements IReactiveObject but does not inherit from ReactiveObject
- Create a partial class that inherits from MyReactiveBase and add a partial property with the [Reactive] attribute
- Build
Try the reproduction repository.
Reproduction repository
https://github.com/megazyz/ReactiveUI.SourceGenerators.Repro1
Expected behavior
[Reactive] properties should work when the containing class implements IReactiveObject but does not inherit from ReactiveObject.
Screenshots 🖼️
No response
IDE
Visual Studio 2022
Operating system
No response
Version
No response
Device
No response
ReactiveUI Version
20.2.45
Additional information ℹ️
No response