Skip to content

CS8785 when generating code for class in global namespace #193

@deerchao

Description

@deerchao

Program.cs

// See https://aka.ms/new-console-template for more information
using OneOf;

Console.WriteLine("Hello, World!");

[GenerateOneOf]
public partial class StringOrNumber : OneOfBase<string, int> { }

Error:

Generator 'OneOfGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'ArgumentException' with message 'The hintName '<global namespace>_StringOrNumber.g.cs' contains an invalid character '<' at position 0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions