From 395e90a786874ebe795e656f532b50110c8c1a98 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Fri, 15 Mar 2013 11:46:19 -0700 Subject: SI-7251, compiler crash with $. We don't need to assert our way out of tight spots, we can issue an error. Or so I once thought. It turns out lots of assertions have been disappearing before being heard thanks to "case t: Throwable". Under such conditions, a failed assertion is a no-op, but an error is an error. The crash associated with SI-7251 is best avoided by removing the assertion, which allows an error to be issued in the normal course of events. In the course of trying to figure out the above, I cleaned up ClassfileParser somewhat. --- test/files/neg/t7251.check | 4 ++++ test/files/neg/t7251/A_1.scala | 10 ++++++++++ test/files/neg/t7251/B_2.scala | 7 +++++++ 3 files changed, 21 insertions(+) create mode 100644 test/files/neg/t7251.check create mode 100644 test/files/neg/t7251/A_1.scala create mode 100644 test/files/neg/t7251/B_2.scala (limited to 'test/files') diff --git a/test/files/neg/t7251.check b/test/files/neg/t7251.check new file mode 100644 index 0000000000..8df8984d63 --- /dev/null +++ b/test/files/neg/t7251.check @@ -0,0 +1,4 @@ +B_2.scala:5: error: object s.Outer$Triple$ is not a value + println( s.Outer$Triple$ ) + ^ +one error found diff --git a/test/files/neg/t7251/A_1.scala b/test/files/neg/t7251/A_1.scala new file mode 100644 index 0000000000..d05373ed28 --- /dev/null +++ b/test/files/neg/t7251/A_1.scala @@ -0,0 +1,10 @@ +package s + +object Outer { + type Triple[+A, +B, +C] = Tuple3[A, B, C] + object Triple { + def apply[A, B, C](x: A, y: B, z: C) = Tuple3(x, y, z) + def unapply[A, B, C](x: Tuple3[A, B, C]): Option[Tuple3[A, B, C]] = Some(x) + } +} + diff --git a/test/files/neg/t7251/B_2.scala b/test/files/neg/t7251/B_2.scala new file mode 100644 index 0000000000..eb59b30902 --- /dev/null +++ b/test/files/neg/t7251/B_2.scala @@ -0,0 +1,7 @@ +package s + +object Test { + def main(args: Array[String]): Unit = { + println( s.Outer$Triple$ ) + } +} -- cgit v1.2.3