-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Fix polluted CompareState when comparing element types in a signature #98198
Conversation
We were propagating state from each type in the method signature to the comparisons for the next type. This resulted in type equivalence checks being disabled for any parameters that came after a generic parameter.
I assume the "See" issue can be converted to a "Fixes"? |
I switched it to 'See' instead of 'Fixes' because wanted to keep it open for a .NET 8 backport. |
/backport to release/8.0-staging |
Started backporting to release/8.0-staging: https://github.com/dotnet/runtime/actions/runs/7850043335 |
@elinor-fung backporting to release/8.0-staging failed, the patch most likely resulted in conflicts: $ git am --3way --ignore-whitespace --keep-non-patch changes.patch
Applying: Fix polluted CompareState when comparing element types in a signature
Applying: Add test
Using index info to reconstruct a base tree...
M src/tests/baseservices/typeequivalence/impl/Impls.cs
M src/tests/baseservices/typeequivalence/simple/Simple.cs
Falling back to patching base and 3-way merge...
Auto-merging src/tests/baseservices/typeequivalence/simple/Simple.cs
CONFLICT (content): Merge conflict in src/tests/baseservices/typeequivalence/simple/Simple.cs
Auto-merging src/tests/baseservices/typeequivalence/impl/Impls.cs
CONFLICT (content): Merge conflict in src/tests/baseservices/typeequivalence/impl/Impls.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0002 Add test
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128 Please backport manually! |
@elinor-fung an error occurred while backporting to release/8.0-staging, please check the run log for details! Error: git am failed, most likely due to a merge conflict. |
We were propagating state from each type in the method signature to the comparisons for the next type. This resulted in type equivalence checks being disabled for any parameters that came after a generic parameter.
See #96268
This regressed in .NET 8.0 after #86932. We probably want to backport, as there isn't really a workaround other than rewriting method signatures.