Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generating of [ObservableObject] fails if interface is declared but not implemented #805

Open
1 task done
ShortDevelopment opened this issue Nov 30, 2023 · 0 comments · May be fixed by #769
Open
1 task done

Generating of [ObservableObject] fails if interface is declared but not implemented #805

ShortDevelopment opened this issue Nov 30, 2023 · 0 comments · May be fixed by #769
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior

Comments

@ShortDevelopment
Copy link

ShortDevelopment commented Nov 30, 2023

Describe the bug

If a class implements an interface that itself inherits INotifyPropertyChanged or INotifyPropertyChanging but does not implement the interface methods, code-generation aborts.

Current tests only test diagnostics for an implementation of INotifyPropertyChanged / INotifyPropertyChanging:

[INotifyPropertyChanged]
public partial class SampleViewModel : INotifyPropertyChanged
{
public event PropertyChangedEventHandler? PropertyChanged;
}

Regression

No response

Steps to reproduce

interface IStuff : INotifyPropertyChanged {
   // ...
}

[ObservableObject]
class B : BaseClass, IStuff {
   // No implementation of INotifyPropertyChanged 
   // source generation
}

Expected behavior

The implementation of INotifyPropertyChanged should be generated.

Screenshots

No response

IDE and version

VS 2022

IDE version

No response

Nuget packages

  • CommunityToolkit.Mvvm (aka MVVM Toolkit)

Nuget package version(s)

8.2.2

Additional context

Similar to #620 but slightly different scenario

Help us help you

Yes, I'd like to be assigned to work on this item

@ShortDevelopment ShortDevelopment added the bug 🐛 An unexpected issue that highlights incorrect behavior label Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior
Projects
None yet
1 participant