CommunityToolkit / dotnet

.NET Community Toolkit is a collection of helpers and APIs that work for all .NET developers and are agnostic of any specific UI platform. The toolkit is maintained and published by Microsoft, and part of the .NET Foundation.
https://docs.microsoft.com/dotnet/communitytoolkit/?WT.mc_id=dotnet-0000-bramin
Other
3.07k stars 299 forks source link

Source generators fail on nested/generic types with Roslyn 4.0.1 #605

Closed Sergio0694 closed 1 year ago

Sergio0694 commented 1 year ago

Describe the bug

Roslyn 4.0.1 doesn't accept special characters in filename hints, and cause generators to fail with nested/generic types.

Steps to reproduce

using System.ComponentModel;
using CommunityToolkit.Mvvm.ComponentModel;

#nullable enable

namespace MyApp;

partial class Foo
{
    partial class MyViewModel<T> : ObservableObject
    {
        [ObservableProperty]
        private string? a;
    }
}

Expected behavior

Should work fine.

IDE and version

VS 2022, VS 2022 Preview

Nuget packages

Nuget package version(s)

8.1.0