diff options
author | Martin Odersky <odersky@gmail.com> | 2008-09-05 13:07:08 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2008-09-05 13:07:08 +0000 |
commit | 5d1339b1211dce7469fddaccecdc0437db41252f (patch) | |
tree | 9655097645c2bc2b272a86e13362efb6d10b303f /test | |
parent | 45e264bfa6d3265a7f0cf447b1bc708e0ee54640 (diff) | |
download | scala-5d1339b1211dce7469fddaccecdc0437db41252f.tar.gz scala-5d1339b1211dce7469fddaccecdc0437db41252f.tar.bz2 scala-5d1339b1211dce7469fddaccecdc0437db41252f.zip |
fixed problem with volatile types.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/neg/null-unsoundness.check | 5 | ||||
-rw-r--r-- | test/files/neg/null-unsoundness.scala | 15 |
2 files changed, 20 insertions, 0 deletions
diff --git a/test/files/neg/null-unsoundness.check b/test/files/neg/null-unsoundness.check new file mode 100644 index 0000000000..5f28e76d06 --- /dev/null +++ b/test/files/neg/null-unsoundness.check @@ -0,0 +1,5 @@ +null-unsoundness.scala:8: error: stable identifier required, but A.this.x found. + Note that value x is not stable because its type, A.this.D with A.this.A, is volatile. + var y: x.T = new C("abc") + ^ +one error found diff --git a/test/files/neg/null-unsoundness.scala b/test/files/neg/null-unsoundness.scala new file mode 100644 index 0000000000..d30ff613b1 --- /dev/null +++ b/test/files/neg/null-unsoundness.scala @@ -0,0 +1,15 @@ +class B +class C(x: String) extends B + +class A { + type A >: Null + class D { type T >: C <: B } + val x: D with A = null + var y: x.T = new C("abc") +} +object Test extends A with Application { + class C { type T = Int; val x = 1 } + type A = C + y = 42 +} + |