Skip to content

Missing/abstract param accessor in implicit parameter of trait #2795

@nicolasstucki

Description

@nicolasstucki
trait Foo[T: ClassTag]() {
  def foo(x: T) = Array(x)
}
class Bar extends Foo[Int]()

fails with a java.lang.AbstractMethodError: Method Bar.Foo$$evidence$1()Lscala/reflect/ClassTag; is abstract

Where the tree after genBCode looks like

<trait> trait Foo extends Object { 
    def $init$(): Unit = ()
    implicit <accessor> def Foo$$evidence$1(): scala.reflect.ClassTag
    def foo(x: Object): Object = 
      Array.apply(Predef.genericWrapArray([x : Object]), this.Foo$$evidence$1())
  }
class Bar
   extends Object with Foo { 
    def <init>(): Unit = 
      {
        super()
        super[Foo].$init$()
        ()
      }
  }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions