Skip to content

[OpenAPI] error CS0308: The non-generic type 'TypeName' cannot be used with type argumentsΒ #61035

@martincostello

Description

@martincostello

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

In verifying some changes noted in #60977 (comment) with the latest nightly build for preview 3, I hit two new issues in both of the referenced apps. They're all related to generics, so they're probably the same single issue so I'll list them all here rather than a separate one per compiler error.

From martincostello/adventofcode@85d3410:

C:\Coding\martincostello\adventofcode\artifacts\obj\AdventOfCode.Site\debug\Microsoft.AspNetCore.OpenApi.SourceGenerators\Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator\OpenApiXmlCommentSupport.generated.cs(536,177): error CS0308: The non-generic type 'Task' cannot be used with type arguments [C:\Coding\martincostello\adventofcode\src\AdventOfCode.Site\AdventOfCode.Site.csproj]
C:\Coding\martincostello\adventofcode\artifacts\obj\AdventOfCode.Site\debug\Microsoft.AspNetCore.OpenApi.SourceGenerators\Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator\OpenApiXmlCommentSupport.generated.cs(611,212): error CS7003: Unexpected use of an unbound generic name [C:\Coding\martincostello\adventofcode\src\AdventOfCode.Site\AdventOfCode.Site.csproj]

From martincostello/alexa-london-travel-site@4b85230 (which includes errors for #61019):

C:\Coding\martincostello\alexa-london-travel-site\artifacts\obj\LondonTravel.Site\release\Microsoft.AspNetCore.OpenApi.SourceGenerators\Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator\OpenApiXmlCommentSupport.generated.cs(466,178): error CS0673: System.Void cannot be used from C# -- use typeof(void) to get the void type object
C:\Coding\martincostello\alexa-london-travel-site\artifacts\obj\LondonTravel.Site\release\Microsoft.AspNetCore.OpenApi.SourceGenerators\Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator\OpenApiXmlCommentSupport.generated.cs(488,247): error CS0308: The non-generic type 'Expression' cannot be used with type arguments
C:\Coding\martincostello\alexa-london-travel-site\artifacts\obj\LondonTravel.Site\release\Microsoft.AspNetCore.OpenApi.SourceGenerators\Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator\OpenApiXmlCommentSupport.generated.cs(507,237): error CS0308: The non-generic type 'Expression' cannot be used with type arguments
C:\Coding\martincostello\alexa-london-travel-site\artifacts\obj\LondonTravel.Site\release\Microsoft.AspNetCore.OpenApi.SourceGenerators\Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator\OpenApiXmlCommentSupport.generated.cs(531,177): error CS0673: System.Void cannot be used from C# -- use typeof(void) to get the void type object
C:\Coding\martincostello\alexa-london-travel-site\artifacts\obj\LondonTravel.Site\release\Microsoft.AspNetCore.OpenApi.SourceGenerators\Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator\OpenApiXmlCommentSupport.generated.cs(538,175): error CS0673: System.Void cannot be used from C# -- use typeof(void) to get the void type object

I'll enable the code output shortly and paste the relevant lines of code.

Expected Behavior

The applications compile.

Steps To Reproduce

Clone either of the two commits and build the solution:

  1. martincostello/adventofcode@85d3410
  2. martincostello/alexa-london-travel-site@4b85230

Exceptions (if any)

No response

.NET Version

10.0.100-preview.3.25169.19

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-openapi

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions