summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2011-01-04 10:19:08 +0000
committerIulian Dragos <jaguarul@gmail.com>2011-01-04 10:19:08 +0000
commit1f4d528702ca32ed01e500ea2ef2e9b2ebbe07d1 (patch)
treea48dc80ebb0774b0098a28ba9ae344dd7c318cc7 /test
parent7c34a1af9612cc696fef9f4d62d1a9a9ef8ff9ae (diff)
downloadscala-1f4d528702ca32ed01e500ea2ef2e9b2ebbe07d1.tar.gz
scala-1f4d528702ca32ed01e500ea2ef2e9b2ebbe07d1.tar.bz2
scala-1f4d528702ca32ed01e500ea2ef2e9b2ebbe07d1.zip
Fixed infinite loop on call to super from a spe...
Fixed infinite loop on call to super from a specialized method. This happened only on illegal specialized inheritance. Closes #3651, no review.
Diffstat (limited to 'test')
-rw-r--r--test/files/run/spec-super.check2
-rw-r--r--test/files/run/spec-super.scala18
2 files changed, 20 insertions, 0 deletions
diff --git a/test/files/run/spec-super.check b/test/files/run/spec-super.check
new file mode 100644
index 0000000000..c04dfc9fdf
--- /dev/null
+++ b/test/files/run/spec-super.check
@@ -0,0 +1,2 @@
+s
+1
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
+}