-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Compiler inserting ???
with inline and erased terms
#11996
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
I believe the inliner replaces erased definitions with final lazy given erased val given_UnivEq_A: UnivEq[A] =
UnivEq.force[A]
if ==*[A](a)[A](a)(given_UnivEq_A).unary_! then
scala.runtime.Scala3RunTime.assertFailed()
else () After inlining: final lazy given erased def given_UnivEq_A: UnivEq[A] = ???
if
{
val x$3$proxy1: UnivEq[A] = ???
(a.==(a):Boolean)
}.unary_!
then scala.runtime.Scala3RunTime.assertFailed() else () Inliner should keep the erased references so that they can be flagged as errors in erasure. |
|
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Apr 8, 2021
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Apr 15, 2021
Instead of erasing an erased term to `???` we erase it to `erasedValue[T]`. This has 2 advantages, first the term does not lose it's type and second the term is still marked as erased. The second implies that if there is a bug in the compiler or a macro where term might end outside an erased context, the code will not compiler. Currently the code compiles and then throws when calling the spurious `???`. See scala#11996.
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Apr 15, 2021
Instead of erasing an erased term to `???` we erase it to `erasedValue[T]`. This has 2 advantages, first the term does not lose it's type and second the term is still marked as erased. The second implies that if there is a bug in the compiler or a macro where term might end outside an erased context, the code will not compiler. Currently the code compiles and then throws when calling the spurious `???`. See scala#11996.
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Apr 15, 2021
Instead of erasing an erased term to `???` we erase it to `erasedValue[T]`. This has 2 advantages, first, the term does not lose its type, and second, the term is still marked as erased. The second implies that if there is a bug in the compiler or a macro where the term might end outside an erased context, the code will not compiler. Currently, the code compiles and then throws when calling the spurious `???`. See scala#11996.
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Apr 15, 2021
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Apr 15, 2021
Instead of erasing an erased term to `???` we erase it to `erasedValue[T]`. This has 2 advantages, first, the term does not lose its type, and second, the term is still marked as erased. The second implies that if there is a bug in the compiler or a macro where the term might end outside an erased context, the code will not compiler. Currently, the code compiles and then throws when calling the spurious `???`. See scala#11996.
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Apr 15, 2021
Instead of erasing an erased term to `???` we erase it to `erasedValue[T]`. This has 2 advantages, first, the term does not lose its type, and second, the term is still marked as erased. The second implies that if there is a bug in the compiler or a macro where the term might end outside an erased context, the code will not compiler. Currently, the code compiles and then throws when calling the spurious `???`. See scala#11996.
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Apr 15, 2021
Instead of erasing an erased term to `???` we erase it to `erasedValue[T]`. This has 2 advantages, first, the term does not lose its type, and second, the term is still marked as erased. The second implies that if there is a bug in the compiler or a macro where the term might end outside an erased context, the code will not compiler. Currently, the code compiles and then throws when calling the spurious `???`. See scala#11996.
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Apr 20, 2021
Instead of erasing an erased term to `???` we erase it to `erasedValue[T]`. This has 2 advantages, first, the term does not lose its type, and second, the term is still marked as erased. The second implies that if there is a bug in the compiler or a macro where the term might end outside an erased context, the code will not compiler. Currently, the code compiles and then throws when calling the spurious `???`. See scala#11996.
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Apr 22, 2021
Instead of erasing an erased term to `???` we erase it to `erasedValue[T]`. This has 2 advantages, first, the term does not lose its type, and second, the term is still marked as erased. The second implies that if there is a bug in the compiler or a macro where the term might end outside an erased context, the code will not compiler. Currently, the code compiles and then throws when calling the spurious `???`. See scala#11996.
michelou
pushed a commit
to michelou/scala3
that referenced
this issue
Apr 27, 2021
Instead of erasing an erased term to `???` we erase it to `erasedValue[T]`. This has 2 advantages, first, the term does not lose its type, and second, the term is still marked as erased. The second implies that if there is a bug in the compiler or a macro where the term might end outside an erased context, the code will not compiler. Currently, the code compiles and then throws when calling the spurious `???`. See scala#11996.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Compiler version
3.0.1-RC1-bin-20210402-775d881-NIGHTLY
Minimized code
Output
Expectation
No runtime exception should be thrown. The compiler has inserted a
???
somewhere.The text was updated successfully, but these errors were encountered: