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
This commit is contained in:
extempore 2011-10-29 19:33:56 +00:00
parent 9013dcd791
commit 1b9f2bf876
2 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,2 @@
(5,5)
(10,10)

24
test/files/run/t102.scala Normal file
View File

@ -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))
}
}