diff options
Diffstat (limited to 'test/files/run/spec-super.scala')
-rw-r--r-- | test/files/run/spec-super.scala | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/files/run/spec-super.scala b/test/files/run/spec-super.scala new file mode 100644 index 0000000000..ae71d72859 --- /dev/null +++ b/test/files/run/spec-super.scala @@ -0,0 +1,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 +} |