From 1b68611e04da4a4fb4ac48a96718e088f0ed432c Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Sat, 29 Oct 2011 19:33:56 +0000 Subject: Test case closes SI-102. No review. --- test/files/run/t102.check | 2 ++ test/files/run/t102.scala | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 test/files/run/t102.check create mode 100644 test/files/run/t102.scala diff --git a/test/files/run/t102.check b/test/files/run/t102.check new file mode 100644 index 0000000000..315f21037d --- /dev/null +++ b/test/files/run/t102.check @@ -0,0 +1,2 @@ +(5,5) +(10,10) diff --git a/test/files/run/t102.scala b/test/files/run/t102.scala new file mode 100644 index 0000000000..6517d8a531 --- /dev/null +++ b/test/files/run/t102.scala @@ -0,0 +1,24 @@ +trait Foo { + type Arg + type Prod + def makeProd(a: Arg): Prod +} + +object Test { + def f1(x: Foo)(y: x.Arg) = x.makeProd(y) + + case class f2[T <: Foo](x: T) { + def apply(y: x.Arg) = x.makeProd(y) + } + + val myFoo = new Foo { + type Arg = Int + type Prod = (Int, Int) + def makeProd(i: Int) = (i, i) + } + + def main(args: Array[String]): Unit = { + println(f1(myFoo)(5)) + println(f2(myFoo)(10)) + } +} -- cgit v1.2.3