Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration binding source generator fails to compile with CS8600 when using nullable reference types #89019

Closed
martincostello opened this issue Jul 17, 2023 · 2 comments · Fixed by #89900
Assignees
Labels
area-Extensions-Configuration blocking-release bug source-generator Indicates an issue with a source generator feature
Milestone

Comments

@martincostello
Copy link
Member

Description

When enabling the configuration binding source generator for a project where nullable types are used, compilation fails with an CS8600 error.

Project\src\Project\Microsoft.Extensions.Configuration.Binder.SourceGeneration\Microsoft.Extensions.Configuration.Binder.SourceGeneration.ConfigurationBindingGenerator\GeneratedConfigurationBinder.g.cs(1070,53): error CS8600: Converting null literal or possible null value to non-nullable type. [Project\src\Project\Project.csproj]

Reproduction Steps

  1. Clone and checkout any of the following commits:
  2. Run build.ps1

Expected behavior

The applications compile and the tests pass.

Actual behavior

The applications fail to compile with CS8600 errors.

Regression?

No.

Known Workarounds

None.

Configuration

.NET SDK 8.0.100-preview.6.23330.14

Other information

No response

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jul 17, 2023
@ghost
Copy link

ghost commented Jul 17, 2023

Tagging subscribers to this area: @dotnet/area-extensions-configuration
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

When enabling the configuration binding source generator for a project where nullable types are used, compilation fails with an CS8600 error.

Project\src\Project\Microsoft.Extensions.Configuration.Binder.SourceGeneration\Microsoft.Extensions.Configuration.Binder.SourceGeneration.ConfigurationBindingGenerator\GeneratedConfigurationBinder.g.cs(1070,53): error CS8600: Converting null literal or possible null value to non-nullable type. [Project\src\Project\Project.csproj]

Reproduction Steps

  1. Clone and checkout any of the following commits:
  2. Run build.ps1

Expected behavior

The applications compile and the tests pass.

Actual behavior

The applications fail to compile with CS8600 errors.

Regression?

No.

Known Workarounds

None.

Configuration

.NET SDK 8.0.100-preview.6.23330.14

Other information

No response

Author: martincostello
Assignees: -
Labels:

untriaged, area-Extensions-Configuration

Milestone: -

@tarekgh tarekgh added the source-generator Indicates an issue with a source generator feature label Jul 17, 2023
@tarekgh tarekgh added this to the 8.0.0 milestone Jul 17, 2023
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Jul 17, 2023
@ericstj
Copy link
Member

ericstj commented Jul 19, 2023

Probably you can workaround with NoWarn in the project file (temporarily).

<NoWarn>$(NoWarn);CS8600</NoWarn>

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Aug 3, 2023
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Aug 3, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Sep 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Extensions-Configuration blocking-release bug source-generator Indicates an issue with a source generator feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants