We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The following code compiles in Scalac, but Dotty produces an error without message when compiled with -language:Scala2:
-language:Scala2
// dotc -d out -language:Scala2 examples/matcher.scala trait Matchers { matchers => private sealed trait Collected extends Product with Serializable def foo[T](collected: Collected, xs: scala.collection.GenTraversable[T]): Int = 3 } object Matchers extends Matchers
The problem is that RefChecks does not take into acount that Collected is visible in Matchers$ under Scala2 mode.
RefChecks
Collected
Matchers$
The missing error message is caused by the incorrect call getMessage instead of toMessage on TypeError.
getMessage
toMessage
https://github.com/lampepfl/dotty/blob/6bb20b33db43171d4b0ca4f7bfcbfbf0d73dcc8c/compiler/src/dotty/tools/dotc/typer/RefChecks.scala#L975-L987
The text was updated successfully, but these errors were encountered:
Fix missing error message
5c70826
This is a partial fix to scala#5831: scala#5831
Fix scala#5831: types in parent visible in child under Scala2
ac7e574
I've been playing this, it seems there is no easy fix without introducing complexity and bugs just for an incorrect behavior in Scala2.
Given that:
We close the issue, and the incompatibility is added to https://github.com/lampepfl/dotty/wiki/Known-incompatibilities-with-scalac .
Sorry, something went wrong.
No branches or pull requests
The following code compiles in Scalac, but Dotty produces an error without message when compiled with
-language:Scala2
:The problem is that
RefChecks
does not take into acount thatCollected
is visible inMatchers$
under Scala2 mode.The missing error message is caused by the incorrect call
getMessage
instead oftoMessage
on TypeError.https://github.com/lampepfl/dotty/blob/6bb20b33db43171d4b0ca4f7bfcbfbf0d73dcc8c/compiler/src/dotty/tools/dotc/typer/RefChecks.scala#L975-L987
The text was updated successfully, but these errors were encountered: