-
Notifications
You must be signed in to change notification settings - Fork 359
Labels
analyzer 👓A new analyzer being implemented or updatedA new analyzer being implemented or updatedmvvm-toolkit 🧰Issues/PRs for the MVVM ToolkitIssues/PRs for the MVVM Toolkit
Description
Describe the bug
The ObservableProperty source generator does not copy new keywords from declaration into the outputted code for partial auto-properties.
Regression
No.
Steps to reproduce
using CommunityToolkit.Mvvm.ComponentModel;
public abstract partial class MyClass : ObservableObject
{
public string MyProperty { get; set; } = string.Empty;
}
public sealed partial class MyDerivedClass : MyClass
{
[ObservableProperty]
public new partial int MyProperty { get; private set; }
}Produces this compilation error
MyDerivedClass.g.cs(10,24): error CS8800: Both partial member declarations must have identical combinations of 'virtual', 'override', 'sealed', and 'new' modifiers.
Expected behavior
Not produce compilation errors by outputting the new keyword.
Screenshots
No response
IDE and version
Other
IDE version
N/A
Nuget packages
- CommunityToolkit.Common
- CommunityToolkit.Diagnostics
- CommunityToolkit.HighPerformance
- CommunityToolkit.Mvvm (aka MVVM Toolkit)
Nuget package version(s)
8.4.0-preview3
Additional context
No response
Help us help you
Yes, I'd like to be assigned to work on this item
Metadata
Metadata
Assignees
Labels
analyzer 👓A new analyzer being implemented or updatedA new analyzer being implemented or updatedmvvm-toolkit 🧰Issues/PRs for the MVVM ToolkitIssues/PRs for the MVVM Toolkit