We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
3.0.0-RC2-bin-20210325-eeb8340-NIGHTLY
sealed trait X[A] object X { erased given unit: X[Unit] = compiletime.erasedValue } def x[A](f: List[A])(using erased X[A]): Int = 123 def y(f: List[Unit]): Int = x(f)
[error] 12 | x(f) [error] | ^ [error] | getter unit is declared as erased, but is in fact used
It should compile.
The text was updated successfully, but these errors were encountered:
Minimized
import scala.language.experimental.erasedDefinitions type X erased def x: X = compiletime.erasedValue def foo(using erased X): Unit = () def test: Unit = foo(using x)
This only affects erased given parameters with no names. The parameter is not marked as erased.
Sorry, something went wrong.
Workaround: name the erased parameters
- def x[A](f: List[A])(using erased X[A]): Int = + def x[A](f: List[A])(using erased xa: X[A]): Int =
Do not drop erased flag from given erased parameters
erased
given erased
ec0f5b8
Fixes scala#11896
nicolasstucki
Successfully merging a pull request may close this issue.
Compiler version
3.0.0-RC2-bin-20210325-eeb8340-NIGHTLY
Minimized code
Output
Expectation
It should compile.
The text was updated successfully, but these errors were encountered: