Log4s / log4s

High-performance SLF4J wrapper for Scala.
Other
171 stars 25 forks source link

Automatic logger naming fails with parametrized classes #3

Closed sarahgerweck closed 10 years ago

sarahgerweck commented 10 years ago

The following code fails to compile on 2.11:

class MyClass[A, B <: Iterable[A]](a: A)(implicit b: B) {
  val logger = org.log4s.getLogger
}

(I suspect the simpler form of class MyClass[A] { val logger = getLogger } will also fail.)

The error occurs because we're generating the code classOf[MyClass] instead of classOf[MyClass[_]] in the Scala 2.11 macro code.