Skip to content

Fix source-gen issue with a binding member access expression being on a separate line from the member expression #90851

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

Closed
layomia opened this issue Aug 19, 2023 · 3 comments
Assignees
Labels
area-Extensions-Configuration blocking-release bug source-generator Indicates an issue with a source generator feature
Milestone

Comments

@layomia
Copy link
Contributor

layomia commented Aug 19, 2023

Same line

Interceptor location is successfully parsed. Project compiles:

var optionsBuilder = services.AddOptions<AppSettings>().BindConfiguration(nameof(AppSettings));

var optionsBuilder = services
    .AddOptions<AppSettings>().BindConfiguration(nameof(AppSettings));

Different line

Parsed interceptor location is inaccurate. Compilation fails with a CSC interceptors error stating that the generated [InterceptsLocation] points to an invalid location.

var optionsBuilder = services.AddOptions<AppSettings>()
    .BindConfiguration(nameof(AppSettings));

var optionsBuilder = services
    .AddOptions<AppSettings>()
    .BindConfiguration(nameof(AppSettings));
@layomia layomia added blocking-release area-Extensions-Configuration source-generator Indicates an issue with a source generator feature labels Aug 19, 2023
@layomia layomia added this to the 8.0.0 milestone Aug 19, 2023
@layomia layomia self-assigned this Aug 19, 2023
@ghost
Copy link

ghost commented Aug 19, 2023

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

Issue Details

Same line

Interceptor location is successfully parsed. Project compiles:

var optionsBuilder = services.AddOptions<AppSettings>().BindConfiguration(nameof(AppSettings));

optionsBuilder = services
    .AddOptions<AppSettings>().BindConfiguration(nameof(AppSettings));

Different line

Parsed interceptor location is inaccurate. Compilation fails with a CSC interceptors error stating that the generated [InterceptsLocation] points to an invalid location.

var optionsBuilder = services.AddOptions<AppSettings>()
    .BindConfiguration(nameof(AppSettings));

var optionsBuilder = services
    .AddOptions<AppSettings>()
    .BindConfiguration(nameof(AppSettings));
Author: layomia
Assignees: layomia
Labels:

blocking-release, area-Extensions-Configuration, source-generator

Milestone: 8.0.0

@layomia
Copy link
Contributor Author

layomia commented Aug 19, 2023

@captainsafia @eerhardt unfortunately this will affect the stage 2 showcase app.

FYI @ericstj.

@layomia
Copy link
Contributor Author

layomia commented Aug 30, 2023

Fixed for 8.0 in #91218.

@layomia layomia closed this as completed Aug 30, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Sep 30, 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

No branches or pull requests

1 participant