From 094cd9ff3b07536f75f3a233606823ae5478d542 Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Tue, 7 Mar 2017 13:13:27 +0100 Subject: Fix #2056: Backend crash when inlined method contains try In various places we do "case EmptyTree =>", since Tree#equals uses reference equality this means that EmptyTree should never be copied, otherwise some other code path will be taken. --- tests/pos/i2056.scala | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 tests/pos/i2056.scala (limited to 'tests/pos') diff --git a/tests/pos/i2056.scala b/tests/pos/i2056.scala new file mode 100644 index 000000000..c4d020fb6 --- /dev/null +++ b/tests/pos/i2056.scala @@ -0,0 +1,13 @@ +object Test { + inline def crash() = { + try { + println("hi") + } catch { + case e: Exception => + } + } + + def main(args: Array[String]): Unit = { + crash() + } +} -- cgit v1.2.3