diff options
author | Martin Odersky <odersky@gmail.com> | 2009-08-10 09:57:54 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2009-08-10 09:57:54 +0000 |
commit | 1e15c075c1ae03cf1d356e45606894efdc57093a (patch) | |
tree | e0240cca1416d74cdf4bf47103f6acb2c87fb4a7 /test | |
parent | dd8009b190fc1f53f98f1313b6292579af79e309 (diff) | |
download | scala-1e15c075c1ae03cf1d356e45606894efdc57093a.tar.gz scala-1e15c075c1ae03cf1d356e45606894efdc57093a.tar.bz2 scala-1e15c075c1ae03cf1d356e45606894efdc57093a.zip |
fixed t1705.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/neg/t1705.check | 7 | ||||
-rwxr-xr-x | test/files/neg/t1705.scala | 35 | ||||
-rwxr-xr-x | test/files/run/existentials.scala | 2 |
3 files changed, 43 insertions, 1 deletions
diff --git a/test/files/neg/t1705.check b/test/files/neg/t1705.check new file mode 100644 index 0000000000..7f75bd0fb5 --- /dev/null +++ b/test/files/neg/t1705.check @@ -0,0 +1,7 @@ +t1705.scala:9: error: can't existentially abstract over parameterized type this.T[Z] + val c = new C{ + ^ +t1705.scala:14: error: can't existentially abstract over parameterized type C[String] + val x1 = { + ^ +two errors found diff --git a/test/files/neg/t1705.scala b/test/files/neg/t1705.scala new file mode 100755 index 0000000000..fabdca0ec6 --- /dev/null +++ b/test/files/neg/t1705.scala @@ -0,0 +1,35 @@ +package trials +object crashing { + trait C { + abstract class T[A] { + def f[Z] (a:T[Z]) : T[A] + } + } + abstract class Thing { + val c = new C{ + class T[A](a:A) { + def f[Z](t:T[Z]) = new T(a) + } + } + val x1 = { + class C[T] { val x: T } + new C[String] + } + } +} +/* + +Infinite loop in Typer.addLocals. Printing all calls to it: + +addLocals: Unit +addLocals: this.T[A] +addLocals: java.lang.Object with crashing.C{ ... } +addLocals: >: Nothing <: java.lang.Object with crashing.C{type T[A] <: java.lang.Object with ScalaObject{def f[Z](this.T[Z]): this.T[A]}} +addLocals: >: Nothing <: java.lang.Object with ScalaObject{def f[Z](this.T[Z]): this.T[Z]} +addLocals: >: Nothing <: java.lang.Object with ScalaObject{def f[Z](this.T[Z]): this.T[Z]} +addLocals: >: Nothing <: java.lang.Object with ScalaObject{def f[Z](this.T[Z]): this.T[Z]} +[...] +* + C { type T[A] <: { def f[Z]: T[Z] => T[A] } } + +*/ diff --git a/test/files/run/existentials.scala b/test/files/run/existentials.scala index 469112b392..471f8fe779 100755 --- a/test/files/run/existentials.scala +++ b/test/files/run/existentials.scala @@ -52,7 +52,7 @@ object Bug1189 { object Test extends Application { - val x = { class I[T]; (new C(new I[String]), new C(new I[Int])) } + val x = { class I; class J; (new C(new I), new C(new J)) } val y: (C[X], C[Y]) forSome { type X; type Y } = x def foo(x : Counter[T] { def name : String } forSome { type T }) = x match { |