summaryrefslogtreecommitdiff
path: root/test/files/run/spec-super.scala
blob: ae71d72859b0406e630780e9fec1196a9b62861e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// see ticket #3651
object Test {
  def main(args: Array[String]) {
    val s = new Extended("s")
    println(s.foo) //works

    val i = new Extended(1)
    println(i.foo) //infinite loop with StackOverflowError
  }
}

class Base[@specialized(Int) T](val t: T) {
  def foo() :T = t
}
class Extended [@specialized(Int) T](t: T) extends Base[T](t) {
  override def foo() :T = super.foo
}