summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-10-29 19:33:56 +0000
committerPaul Phillips <paulp@improving.org>2011-10-29 19:33:56 +0000
commit1b68611e04da4a4fb4ac48a96718e088f0ed432c (patch)
tree282437be070c5b2352b107b99cdb7fa295e9ae58
parent456aee6cadc27aa1f0422f6ea201e72b7e38b2e0 (diff)
downloadscala-1b68611e04da4a4fb4ac48a96718e088f0ed432c.tar.gz
scala-1b68611e04da4a4fb4ac48a96718e088f0ed432c.tar.bz2
scala-1b68611e04da4a4fb4ac48a96718e088f0ed432c.zip
Test case closes SI-102.
No review.
-rw-r--r--test/files/run/t102.check2
-rw-r--r--test/files/run/t102.scala24
2 files changed, 26 insertions, 0 deletions
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))
+ }
+}