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
object generation compiles successfully. #12322
Comments
If you wrap it in a class you get an AssertionError. class Wrapper {
object MyObj
val obj = new MyObj.type
} Click for AssertionError
|
The assertion is: assert(sym != NoSymbol, "transformCaseApply: name = " + name.debugString + " tree = " + tree + " / " + tree.getClass) //debug and that output above is:
|
Could this have been caused by scala/scala#9279 ? |
@sjrd Yes, it affects this check. |
Something even more ominous: scala> object Foo
object Foo
scala> type Bar = Foo.type
type Bar
scala> val a = new Bar
val a: Foo.type = Foo$@678e08c0
scala> val b = new Bar
val b: Foo.type = Foo$@1fa8d460
scala> a == b
val res2: Boolean = false |
Everyone, Thanks. I don't know if it's related, but it seems that it can be inherited. scala> object Foo
object Foo
scala> type Bar = Foo.type
type Bar
scala> class Baz extends Bar
class Baz
scala> class Baz extends Foo.type // java.lang.AssertionError I hope it will be fixed at the same time. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
reproduction steps
using Scala 2.13.4,
I can compile by instantiating an object.
The following code produces a
java.lang.IllegalAccessError
at runtime:In Scala 2.13.3 or older, a compile error.
problem
Unable to detect object instantiation error at compile time.
The text was updated successfully, but these errors were encountered: