Skip to content

[RDG] Account of parameter name in signature comparison #50064

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

Merged
merged 2 commits into from
Aug 14, 2023

Conversation

captainsafia
Copy link
Member

Closes #50048.

@@ -162,7 +162,7 @@ namespace Microsoft.AspNetCore.Http.Generated
createRequestDelegate);
}

[InterceptsLocation(@"TestMapActions.cs", 27, 5)]
[InterceptsLocation(@"TestMapActions.cs", 26, 5)]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changed because we removed the #pragma disable line preceding this invocation.

@@ -172,6 +168,346 @@ namespace Microsoft.AspNetCore.Http.Generated
createRequestDelegate);
}

[InterceptsLocation(@"TestMapActions.cs", 26, 5)]
internal static RouteHandlerBuilder MapGet1(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each of these handlers has the same signature but different parameter sources and names and now generates different interceptor methods.

@@ -122,9 +122,7 @@ public async Task MapAction_ExplicitBodyParam_ComplexReturn_Snapshot()
};
var source = $"""
app.MapPost("/fromBodyRequired", ([FromBody] Todo todo) => TypedResults.Ok(todo));
#pragma warning disable CS8622
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interceptors fixed generating overloads for methods with the same signature but differing nullability so we no longer have a warning to suppress.

@captainsafia captainsafia merged commit ee13aad into main Aug 14, 2023
@captainsafia captainsafia deleted the safia/route-param-fix branch August 14, 2023 22:27
@ghost ghost added this to the 8.0-rc1 milestone Aug 14, 2023
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

query parameter does not work correctly in net 8 preview 7 under native aot
3 participants