Skip to content

[0.13.10] unexpected java.lang.NoSuchFieldError when use nested case class #2411

@xuwei-k

Description

@xuwei-k

project/build.properties

sbt.version=0.13.10-RC1

A.scala

package example

class A {
  case class B(x: Int)

  def c = B
}

object A {
  def main(args: Array[String]): Unit = {
    (new A).c
  }
}

result

[error] (run-main-15) java.lang.NoSuchFieldError: B$module
java.lang.NoSuchFieldError: B$module
        at example.A.B(A.scala:4)
        at example.A.c(A.scala:6)
        at example.A$.main(A.scala:11)
        at example.A.main(A.scala)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
[trace] Stack trace suppressed: run last compile:run for the full output.
java.lang.RuntimeException: Nonzero exit code: 1
        at scala.sys.package$.error(package.scala:27)
[trace] Stack trace suppressed: run last compile:run for the full output.
[error] (compile:run) Nonzero exit code: 1

There is same problem in playframework, scalikejdbc, skinny-framework, cats.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions