Open
Description
Compiler version
3.2.1
Minimized code
import scala.reflect.ClassTag
abstract class Companion[C](implicit val ct: ClassTag[C])
case class Impl()
object Impl extends Companion[Impl]
Output
-- Error: Test.scala:7:35 -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
7 |object Impl extends Companion[Impl]
| ^
| super constructor cannot be passed a self reference Impl.ct unless parameter is declared by-name
1 error found
Expectation
It's trying to use Impl.ct
as the implicit value to pass to the super constructor, but that obviously doesn't work. I would expect this to get the implicit ClassTag
from wherever implicit ClassTag
s are normally gotten from. This works fine in scala 2. Removing the val
also fixes it, but then you don't have the ClassTag
field