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
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
Describe the bug
The ObservableProperty source generator does not copy
newkeywords from declaration into the outputted code for partial auto-properties.Regression
No.
Steps to reproduce
Produces this compilation error
Expected behavior
Not produce compilation errors by outputting the
newkeyword.Screenshots
No response
IDE and version
Other
IDE version
N/A
Nuget packages
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