Skip to content

VerifyError with implicit ClassTag in companion object #11208

Closed
@hughsimpson

Description

@hughsimpson

The following throws a VerifyError (Tested with 3.0.0-M3)

import scala.reflect.ClassTag

@main def run = println(Foo)

abstract class Bar[T](implicit val thisClassTag: ClassTag[T])

class Foo
object Foo extends Bar[Foo]

Alternatives tried:

  • Changing abstract class Bar[T](implicit val thisClassTag: ClassTag[T]) to abstract class Bar[T: ClassTag]{ val thisClassTag: ClassTag[T] = implicitly[ClassTag[T]] } works
  • Changing object Foo extends Bar[Foo] to object Foo extends Bar()(classTag[Foo]) works
  • Summoning an implicit of a different class works (only ClassTag specifically seems to be affected)
  • Using the ClassTag of anything other than the companion class works (object Foo extends Bar[Foo2] seems fine)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions