You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that a large intersection type is inferred for the first type argument of flatMap: EnvOutA & EnvOutB & EnvOutC & ....
However, before 3.5, the inferred type is EnvOutA & EnvOutB, which should cover the intersection of all alphabetic types A & B & C & ....
We know EnvOutC = A & B & D & ... is a super type of EnvOutA & EnvOutB, but EnvOutA is not a subtype of EnvOutC, same with EnvOutB.
We want dropIfSuper(EnvOutC, EnvOutA & EnvOutB) to return NoType, but inside the body, EnvOutC is a type alias, so tp match ... does not go to the AndType case.
Then, it tries to compare isSuperOf(EnvOutA) or isSuperOf(EnvOutB). In both cases, the results are clearly false.
Before 3.5, dropIfSuper checks the subtype of two arguments directly at first, hence it can avoid this issue.
…dropIfSub (#20523)
Improve compiling in #20516.
We need to be careful to check branches of AndTypes and OrTypes in
correct order, see discussion in issue #20516.
Fall back to direct subtype comparison at the end in dropIfSuper and
dropIfSub.
We may need to improve subtype checking for large intersections further
to be able to fully test the example.
The compilation of following code inflicts a significant raise of compilation time in the last Scala 3 versions
Originally posted by @rlecomte in #20120 (comment)
The text was updated successfully, but these errors were encountered: