Skip to content

[Bug]: BindableDerivedListGenerator creates internal properties for internal classes #387

@jogivanknobi

Description

@jogivanknobi

Describe the bug 🐞

The BindableDerivedListGenerator seems to be using the visibility of the class to generate the properties instead of making it public.

Step to reproduce

  1. ViewModel class:
internal partial class ViewModel : ReactiveObject
{
    [BindableDerivedList]
    private readonly ReadOnlyObservableCollection<string> _theList;
}

This generates:

internal partial class ViewModel
{
    [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.BindableDerivedListGenerator", "2.6.0.0")]
    /// <inheritdoc cref="_theList"/>
    [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
    internal global::System.Collections.ObjectModel.ReadOnlyObservableCollection<string> TheList => _theList;
}

Reproduction repository

No response

Expected behavior

Expected result:

internal partial class ViewModel
{
    [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.BindableDerivedListGenerator", "2.6.0.0")]
    /// <inheritdoc cref="_theList"/>
    [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
    public global::System.Collections.ObjectModel.ReadOnlyObservableCollection<string> TheList => _theList;
}

Screenshots 🖼️

No response

IDE

Visual Studio 2022

Operating system

Windows 11

Version

No response

Device

PC

ReactiveUI Version

2.6.1

Additional information ℹ️

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions