aspnetcore icon indicating copy to clipboard operation
aspnetcore copied to clipboard

Descriptive Error for Improper Use of [AsParameters]

Open smnsht opened this issue 1 year ago • 4 comments

Descriptive Error for Improper Use of [AsParameters]

Description

  1. Throw NotSupportedException if [AsParameters] is applied to an enumerable class.

  2. Preserve existing behavior for collections that are also abstract classes, like IFormCollection. In order to do this, a dedicated unit test was added.

Fixes #56114

smnsht avatar Oct 03 '24 10:10 smnsht

Converting draft to PR despite some failing tests in Interop.FunctionalTests.

[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/41074")] [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/39985")]

Justification:

Seems like those tests failed with no regard to my changes. Also, tests are failing for the main branch. Also, I spotted merged PR's with failed tests in this area.

smnsht avatar Oct 03 '24 14:10 smnsht

FYI @captainsafia

amcasey avatar Oct 03 '24 20:10 amcasey

/azp run

smnsht avatar Oct 19 '24 07:10 smnsht

Commenter does not have sufficient privileges for PR 58218 in repo dotnet/aspnetcore

azure-pipelines[bot] avatar Oct 19 '24 07:10 azure-pipelines[bot]

/azp run

captainsafia avatar Oct 22 '24 23:10 captainsafia

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar Oct 22 '24 23:10 azure-pipelines[bot]

@smnsht Thanks for changing the code here!

I also realized that similar to the other PR you're working on, we'll need to add checks in the RDG implementation for this. Here is the code that needs to be modified in the source generator. Instead of throwing there, we emit diagnostics when the type is invalid.

captainsafia avatar Oct 29 '24 18:10 captainsafia

@captainsafia

I also realized that similar to the other PR you're working on, we'll need to add checks in the RDG implementation for this. Here is the code that needs to be modified in the source generator. Instead of throwing there, we emit diagnostics when the type is invalid.

Done

smnsht avatar Nov 02 '24 10:11 smnsht

/azp run

captainsafia avatar Jan 06 '25 15:01 captainsafia

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar Jan 06 '25 15:01 azure-pipelines[bot]