From 1b9f2bf8769af279058504f0e9c7e1e7d3683786 Mon Sep 17 00:00:00 2001 From: extempore Date: Sat, 29 Oct 2011 19:33:56 +0000 Subject: [PATCH] Test case closes SI-102. No review. git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25907 5e8d7ff9-d8ef-0310-90f0-a4852d11357a --- 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 000000000..315f21037 --- /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 000000000..6517d8a53 --- /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)) + } +}