Revert "Handle canonical types in casting logic"#127301
Revert "Handle canonical types in casting logic"#127301MichalStrehovsky merged 1 commit intomainfrom
Conversation
This reverts commit 7bba220.
There was a problem hiding this comment.
Pull request overview
This PR reverts #127146, removing recently-added canonical type handling in the CoreCLR NativeAOT TypeSystem casting/constraint logic and backing out the associated tests.
Changes:
- Remove canonical-type-aware casting/constraint helpers and related normalization in dataflow handling.
- Remove unit tests and smoke test coverage that were added to validate canonical type behavior.
- Update project files to stop compiling the reverted Canon/NonCanon helper sources.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/tests/nativeaot/SmokeTests/TrimmingBehaviors/Dataflow.cs | Removes a trimming smoke test case that exercised constrained generic MakeGenericType behavior. |
| src/coreclr/tools/aot/ILCompiler.TypeSystem/ILCompiler.TypeSystem.csproj | Stops including Canon helper sources that were added in the reverted change. |
| src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/GenericConstraints.cs | Removes test types used only by the reverted canonical constraints tests. |
| src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ConstraintsValidationTest.cs | Removes the canonical constraints validation test method. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/Dataflow/HandleCallAction.cs | Removes instantiation normalization that was added for canonical shapes prior to constraint checking. |
| src/coreclr/tools/ILVerification/ILVerification.projitems | Removes NonCanon helper compile items that were introduced by the reverted change. |
| src/coreclr/tools/Common/TypeSystem/Common/TypeSystemConstraintsHelpers.cs | Reverts canonical-type constraint handling (and removes partial split support used by the reverted change). |
| src/coreclr/tools/Common/TypeSystem/Common/TypeSystemConstraintsHelpers.NonCanon.cs | Deletes the NonCanon stub file introduced by the reverted change. |
| src/coreclr/tools/Common/TypeSystem/Common/CastingHelper.cs | Reverts canonical-type casting logic additions. |
| src/coreclr/tools/Common/TypeSystem/Common/CastingHelper.NonCanon.cs | Deletes the NonCanon stub file introduced by the reverted change. |
| src/coreclr/tools/Common/TypeSystem/Canon/TypeSystemConstraintsHelpers.Canon.cs | Deletes the Canon implementation file introduced by the reverted change. |
| src/coreclr/tools/Common/TypeSystem/Canon/CastingHelper.Canon.cs | Deletes the Canon implementation file introduced by the reverted change. |
| src/coreclr/nativeaot/System.Private.TypeLoader/src/System.Private.TypeLoader.csproj | Stops including Canon casting helper source introduced by the reverted change. |
It doesn't match CanCastTo in the VM: #127259 (comment) and it would be preferable to have it match. I started #127146 with the logic not being in the CanCastTo (the first commit has that), but copilot wasn't able to come up with anything reliable (the first commit was not oneshotted, this took like 4 iterations of me pointing out flaws in it and it adding tests and fixing the bugs). Then I lost confidence in being able to do it reliably there and moved it to CanCastTo (that one was pretty much oneshotted). I'll need to think about what to do here (hence the revert so that there's no time pressure). |
|
/ba-g there's some Helix service bus issues, but this is just a revert from a couple dozen hours ago and relevant native AOT legs passes. we should not ship preview 4 with this bug. |
Resolves #127259
Reverts #127146