Only allow expanding generics to form intersection constraints a limited number of times#47897
Only allow expanding generics to form intersection constraints a limited number of times#47897weswigham wants to merge 1 commit intomicrosoft:mainfrom
Conversation
…ted number of times
| return result; | ||
| } | ||
| } | ||
| doDistributiveCheck = true; |
There was a problem hiding this comment.
This just moves checking of the distributive constraint to after checking the normal conditional constraint, which is needed to remove an instantiation depth error from the example repo in #46900 after the intersection constraint is no longer expanded forever. (And is singlehandedly what causes the reshuffling of all the error messages in this PR)
|
I don't yet have a truly minimal repro from #46900 (just the submission that uses ~5 packages of types), because the types involved are quite complicated, however I'm going to endeavor to create one now that I have a fix that I know works ready. |
|
I'm not sure we need this PR as the issue appears to already be fixed by #47738. That PR moves logic from the I think we should just merge #47738 for 4.6. I took Daniel's comment here to mean hold until after 4.6, but I do think the changes are safe. |
|
We're already post-4.6 in |
|
Superseded by #47738 |
Fixes #46900
This prevents us from (slowly) infinitely expanding our constraints as we're comparing intersections of generics to unions.