The following Scala code is not compiled in Scala 2.7.7, with a "found: Zero (zero): T" mismatch error in the last line:
/** * @param [T] key type */ class Key[T] class Entry[T](val k: Key[T], val v: T) def makeEntry[T <: AnyRef] = new Entry[T](new Key[T], null)
I am fully aware of the viciousness of zeros, but suffice it to say that I really need to do this. Is this a compiler error or a programmer error?
Edit: Just to clarify, T is a type parameter, not a specific type. I did not understand that this was ambiguous in the original question until I read Karl's answer more carefully.
scala compiler-errors
Aaron Novstrup
source share