diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-09-15 07:21:26 -0700 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-09-15 07:21:26 -0700 |
commit | c2f7ce5cbbc3ccd086764e49c47e139786e0ab24 (patch) | |
tree | 5779d4b901132c164a94e75f52916fb2cf3bdc92 /test/files/neg | |
parent | f3d9bdc283a82b816218aefc3df7d287e0cdd271 (diff) | |
parent | 27d73ee7a92d8dd10d4d0598a29d3a3657053995 (diff) | |
download | scala-c2f7ce5cbbc3ccd086764e49c47e139786e0ab24.tar.gz scala-c2f7ce5cbbc3ccd086764e49c47e139786e0ab24.tar.bz2 scala-c2f7ce5cbbc3ccd086764e49c47e139786e0ab24.zip |
Merge pull request #2884 from retronym/ticket/3832
SI-1909 SI-3832 SI-7007 SI-7223 Improved handling of larval objects
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/t1909-object.check | 4 | ||||
-rw-r--r-- | test/files/neg/t1909-object.flags | 1 | ||||
-rw-r--r-- | test/files/neg/t1909-object.scala | 12 | ||||
-rw-r--r-- | test/files/neg/t7007.check | 7 | ||||
-rw-r--r-- | test/files/neg/t7007.scala | 14 |
5 files changed, 38 insertions, 0 deletions
diff --git a/test/files/neg/t1909-object.check b/test/files/neg/t1909-object.check new file mode 100644 index 0000000000..401c1f7ebf --- /dev/null +++ b/test/files/neg/t1909-object.check @@ -0,0 +1,4 @@ +t1909-object.scala:4: error: !!! SI-1909 Unable to STATICally lift object InnerTrouble$1, which is defined in the self- or super-constructor call of class Kaboom. A VerifyError is likely. + object InnerTrouble + ^ +one error found diff --git a/test/files/neg/t1909-object.flags b/test/files/neg/t1909-object.flags new file mode 100644 index 0000000000..eb8b40661b --- /dev/null +++ b/test/files/neg/t1909-object.flags @@ -0,0 +1 @@ +-Xdev -Xfatal-warnings
\ No newline at end of file diff --git a/test/files/neg/t1909-object.scala b/test/files/neg/t1909-object.scala new file mode 100644 index 0000000000..d6011ba4a5 --- /dev/null +++ b/test/files/neg/t1909-object.scala @@ -0,0 +1,12 @@ +class Kaboom(a: Any) { + def this() = { + this({ + object InnerTrouble + InnerTrouble + }) + } +} + +object Test extends App { + new Kaboom() +}
\ No newline at end of file diff --git a/test/files/neg/t7007.check b/test/files/neg/t7007.check new file mode 100644 index 0000000000..e22ecb9e4e --- /dev/null +++ b/test/files/neg/t7007.check @@ -0,0 +1,7 @@ +t7007.scala:5: error: Implementation restriction: <$anon: A => B> requires premature access to class Crash. + def this(a: Seq[A]) = this(a.collect{ case b: B => b}, a.collect{ case b: B => b}) + ^ +t7007.scala:5: error: Implementation restriction: <$anon: A => B> requires premature access to class Crash. + def this(a: Seq[A]) = this(a.collect{ case b: B => b}, a.collect{ case b: B => b}) + ^ +two errors found diff --git a/test/files/neg/t7007.scala b/test/files/neg/t7007.scala new file mode 100644 index 0000000000..e41dccf550 --- /dev/null +++ b/test/files/neg/t7007.scala @@ -0,0 +1,14 @@ +class A +class B extends A + +class Crash(b1: Seq[B], b2: Seq[B]) { + def this(a: Seq[A]) = this(a.collect{ case b: B => b}, a.collect{ case b: B => b}) +} + +object Main extends App { + + // runtime exception with either constructor + val c1 = new Crash(Seq(new B, new B)) + val c2 = new Crash(Seq(new B), Seq(new B)) + +} |