1
/** Test contributed by Stefan Zeiger showing that HLists can be
8
type |: [E] = HCons[E, Self]
10
final def |: [@specialized E](elem: E): |: [E] = new HCons[E, Self](elem, this.asInstanceOf[Self])
12
def m[@specialized E, T <: AnyRef](x: E): T = null.asInstanceOf[T]
15
final class HCons[@specialized H, T <: HList](val head: H, val tail: T) extends HList {
16
type Self = HCons[H, T]
19
final object HNil extends HList {
23
object Test extends App {
24
val l1 = new HCons(42, "foo" |: HNil)
27
val l2 = 42 |: "abc" |: HNil