diff options
author | michelou <michelou@epfl.ch> | 2008-06-10 10:27:45 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2008-06-10 10:27:45 +0000 |
commit | 0dabdc7b17a02f1d36a99cd21acfdc0b2498f951 (patch) | |
tree | 05e7999dc39a0faf11ca743d7314b178a9823026 /test/files/pos/t0786.scala | |
parent | 943f6dda3b32057a3d9e91c68baac8971d94e567 (diff) | |
download | scala-0dabdc7b17a02f1d36a99cd21acfdc0b2498f951.tar.gz scala-0dabdc7b17a02f1d36a99cd21acfdc0b2498f951.tar.bz2 scala-0dabdc7b17a02f1d36a99cd21acfdc0b2498f951.zip |
int -> Int, etc..
Diffstat (limited to 'test/files/pos/t0786.scala')
-rw-r--r-- | test/files/pos/t0786.scala | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/test/files/pos/t0786.scala b/test/files/pos/t0786.scala index d23cdb741b..f40cf7d2e1 100644 --- a/test/files/pos/t0786.scala +++ b/test/files/pos/t0786.scala @@ -1,29 +1,29 @@ object ImplicitProblem { - class M[T] + class M[T] - def nullval[T] = null.asInstanceOf[T]; + def nullval[T] = null.asInstanceOf[T]; - trait Rep[T] { - def eval: int - } + trait Rep[T] { + def eval: Int + } - implicit def toRep0(n: int) = new Rep[int] { - def eval = 0 - } + implicit def toRep0(n: Int) = new Rep[Int] { + def eval = 0 + } - implicit def toRepN[T](n: M[T])(implicit f: T => Rep[T]) = new Rep[M[T]] { - def eval = f(nullval[T]).eval + 1 - } + implicit def toRepN[T](n: M[T])(implicit f: T => Rep[T]) = new Rep[M[T]] { + def eval = f(nullval[T]).eval + 1 + } - def depth[T <% Rep[T]](n: T) = n.eval + def depth[T <% Rep[T]](n: T) = n.eval - def main(args: Array[String]) { - println(depth(nullval[M[int]])) // (1) this works - println(nullval[M[int]].eval) // (2) this works + def main(args: Array[String]) { + println(depth(nullval[M[Int]])) // (1) this works + println(nullval[M[Int]].eval) // (2) this works - type m = M[int] - println(depth(nullval[m])) // (3) this doesn't compile on 2.7.RC1 - println(nullval[m].eval) // (4) this works - } + type m = M[Int] + println(depth(nullval[m])) // (3) this doesn't compile on 2.7.RC1 + println(nullval[m].eval) // (4) this works + } } |