Uploaded image for project: 'Scala Programming Language'
  1. Scala Programming Language
  2. SI-9948

AbstractMethodError with separate compilation of subclass of trait containing inner class

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: Scala 2.11.0, Scala 2.11.8, Scala 2.12.0-RC1
    • Fix Version/s: None
    • Component/s: Compiler (Misc)
    • Labels:

      Description

      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)
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              rdgreen Robin Green
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: