Skip to content
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

AbstractMethodError with separate compilation of subclass of trait containing inner class #9948

Open
scabug opened this issue Oct 5, 2016 · 1 comment

Comments

@scabug
Copy link

scabug commented Oct 5, 2016

This bug only occurs when separately compiling the two files:

File 1:

trait TypeHints {

  def + (hints: TypeHints): TypeHints = CompositeTypeHints()

  private[TypeHints] case class CompositeTypeHints() extends TypeHints

}

File 2:

class CustomTypeHints extends TypeHints {
}

object Test extends App {
  new CustomTypeHints() + new TypeHints{}
}

Expected output:
(no output)

Actual output:

java.lang.AbstractMethodError: CustomTypeHints.TypeHints$$CompositeTypeHints()LTypeHints$CompositeTypeHints$;
        at TypeHints$class.$plus(Bug.scala:3)
        at CustomTypeHints.$plus(Bug2.scala:1)
        at Test$.delayedEndpoint$Test$1(Bug2.scala:5)
        at Test$delayedInit$body.apply(Bug2.scala:4)
        at scala.Function0$class.apply$mcV$sp(Function0.scala:34)
        at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
        at scala.App$$anonfun$main$1.apply(App.scala:76)
        at scala.App$$anonfun$main$1.apply(App.scala:76)
        at scala.collection.immutable.List.foreach(List.scala:381)
        at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:35)
        at scala.App$class.main(App.scala:76)
        at Test$.main(Bug2.scala:4)
        at Test.main(Bug2.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)
        at scala.reflect.internal.util.ScalaClassLoader$$anonfun$run$1.apply(ScalaClassLoader.scala:70)
        at scala.reflect.internal.util.ScalaClassLoader$class.asContext(ScalaClassLoader.scala:31)
        at scala.reflect.internal.util.ScalaClassLoader$URLClassLoader.asContext(ScalaClassLoader.scala:101)
        at scala.reflect.internal.util.ScalaClassLoader$class.run(ScalaClassLoader.scala:70)
        at scala.reflect.internal.util.ScalaClassLoader$URLClassLoader.run(ScalaClassLoader.scala:101)
        at scala.tools.nsc.CommonRunner$class.run(ObjectRunner.scala:22)
        at scala.tools.nsc.ObjectRunner$.run(ObjectRunner.scala:39)
        at scala.tools.nsc.CommonRunner$class.runAndCatch(ObjectRunner.scala:29)
        at scala.tools.nsc.ObjectRunner$.runAndCatch(ObjectRunner.scala:39)
        at scala.tools.nsc.MainGenericRunner.runTarget$1(MainGenericRunner.scala:65)
        at scala.tools.nsc.MainGenericRunner.run$1(MainGenericRunner.scala:87)
        at scala.tools.nsc.MainGenericRunner.process(MainGenericRunner.scala:98)
        at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:103)
        at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
@scabug
Copy link
Author

scabug commented Oct 5, 2016

Imported From: https://issues.scala-lang.org/browse/SI-9948?orig=1
Reporter: Robin Green (rdgreen)
Affected Versions: 2.11.0, 2.11.8, 2.12.0-RC1

xuwei-k added a commit to xuwei-k/json4s that referenced this issue Jun 26, 2019
xuwei-k added a commit to json4s/json4s that referenced this issue Jun 26, 2019
xuwei-k added a commit to xuwei-k/json4s that referenced this issue Jun 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant