Closed n-ski closed 3 weeks ago
Other attributes also need this one.
[Description("Property")]
[Reactive]
string? _myProperty;
generated
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "2.0.0.0")]
/// <inheritdoc cref="_myProperty"/>
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public string? MyProperty { get => _myProperty; set => this.RaiseAndSetIfChanged(ref _myProperty, value); }
Description
is missing.
Tested in version 2.0.9 and 1.1.31. Neither of them can handle this.
Maybe an optional parameter is better, like [Reactive(ForwardAttributes = true)]
.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Describe the bug 🐞
If a class is marked with the
IViewForAttribute<T>
, the generator will carry over other attributes to the generated partial class. This means that such attributes asSingleInstanceViewAttribute
andViewContractAttribute
cannot be used in conjunction withIViewForAttribute<T>
.Step to reproduce
From the CLI, run
dotnet new globaljson --sdk-version 8.0.400
dotnet new wpf
dotnet add package ReactiveUI --version 20.1.63
dotnet add package ReactiveUI.SourceGenerators --version 2.0.9
Add a minimal view model class and attributes in MainWindow.xaml.cs.
Run
dotnet build
to compile. Observe the compilation error.Reproduction repository
https://github.com/n-ski/RxUIIViewForGeneratorBugSample
Expected behavior
I should be able to use
IViewForAttribute<T>
with other attributes.Screenshots 🖼️
No response
IDE
Rider Windows
Operating system
Windows
Version
21H2
Device
No response
ReactiveUI Version
20.1.63
Additional information ℹ️
No response