Skip to content

[Bug]: All generators cannot handle generic class #115

@ethpch

Description

@ethpch

Describe the bug 🐞

I have tried the latest version 2.0.9, and find some unexpected error.

As the title says, all generators cannot generate code for generic types like Foo<T>. Error messages are 生成器[GeneratorName]未能生成源。它不会影响输出,因此可能会造成编译错误。异常的类型为“ArgumentException”,显示消息“hintName“TestClass2<T>.IViewFor.g.cs”在位置 10 处包含无效字符“<”。 All generators behave like this, [Reactive], [ObservableAsProperty], [ReactiveCommand], [IViewFor], [RoutedControlHost], ViewModelControlHost. Finally no code is generated.

Minimal reproduction repository is below.

Non-generic class and version 1.1.31 work well.

Step to reproduce

  1. Clone the minimal reproduction repository
  2. Build
  3. See error

Reproduction repository

https://github.com/ethpch/ReactiveUI.SourceGenerators.GenericClassBug

Expected behavior

Code is generated as expected

Screenshots 🖼️

image

IDE

No response

Operating system

No response

Version

No response

Device

No response

ReactiveUI Version

No response

Additional information ℹ️

I find some of your documentation is wrong, like [IViewFor(...)]. #61 says now IViewFor uses generic type, and do not accept string as parameter anymore. Can you correct the documentation? Maybe next time, but finally a correct documentation is better.

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