-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Compilation failure under -Ycheck:typer involving type aliases and implicit search #16524
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
Comments
This regressed in 50eb0e9 when `current.ensureNonCyclic` was incorrectly replaced by `validBoundsFor` which operates on `this`, not `current`. This isn't the first time we make this error (cf a8641c5), maybe we should refactor OrderingConstraint so that operations on `current` are done in the companion object where `this` isn't accessible. Fixes scala#16471. Note that the test case from this issue couldn't be added because it fails `-Ycheck:typer`, but this was also the case before the regression. This is now tracked by scala#16524.
This regressed in 50eb0e9 when `current.ensureNonCyclic` was incorrectly replaced by `validBoundsFor` which operates on `this`, not `current`. This isn't the first time we make this error (cf a8641c5), maybe we should refactor OrderingConstraint so that operations on `current` are done in the companion object where `this` isn't accessible. Fixes #16471. Note that the test case from this issue couldn't be added because it fails `-Ycheck:typer`, but this was also the case before the regression. This is now tracked by #16524.
It's hard to be sure if this is truly minimal, but Dale & and I found this minimization and haven't been able to reduce it further. trait Foo
trait Bar[A] { type Res }
class Box[B](value: B)
trait Opt[+C]
abstract class Test:
def meth[D](box: Box[T], bar1: Bar[T], bar2: Bar[T]): bar2.Res
def bar[E]: Bar[Opt[E & Foo]] { type Res = E }
val int: Opt[Int & Foo]
def test: Int = meth(Box(int), bar, bar) We're groveling through typer logs trying to figure out how the bad (There are some doubled |
This regressed in 50eb0e9 when `current.ensureNonCyclic` was incorrectly replaced by `validBoundsFor` which operates on `this`, not `current`. This isn't the first time we make this error (cf a8641c5), maybe we should refactor OrderingConstraint so that operations on `current` are done in the companion object where `this` isn't accessible. Fixes scala#16471. Note that the test case from this issue couldn't be added because it fails `-Ycheck:typer`, but this was also the case before the regression. This is now tracked by scala#16524.
Compiler version
3.2.1
Minimized code
The following code adapted from #16471 fails
-Ycheck:typer
(as well as-Yno-deep-subtypes
)Output
Expectation
If
-Ycheck:typer
fails, it means there's a bug in the typechecker somewhere that needs to be fixed.The text was updated successfully, but these errors were encountered: