From 4276f61551b89162001dadbb3b77f29a85c19c4a Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Fri, 13 Jul 2012 14:13:50 +0200 Subject: SI-6077 more conservative TreeMakersToConds for CSE we were dropping irrefutable extractor calls (implemented for SI-4691) in common subcondition elimination, which caused bad code to be generated clean up TreeMakersToConds significantly in the process --- test/files/run/t6077_patmat_cse_irrefutable.check | 1 + test/files/run/t6077_patmat_cse_irrefutable.scala | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 test/files/run/t6077_patmat_cse_irrefutable.check create mode 100644 test/files/run/t6077_patmat_cse_irrefutable.scala (limited to 'test/files/run') diff --git a/test/files/run/t6077_patmat_cse_irrefutable.check b/test/files/run/t6077_patmat_cse_irrefutable.check new file mode 100644 index 0000000000..9766475a41 --- /dev/null +++ b/test/files/run/t6077_patmat_cse_irrefutable.check @@ -0,0 +1 @@ +ok diff --git a/test/files/run/t6077_patmat_cse_irrefutable.scala b/test/files/run/t6077_patmat_cse_irrefutable.scala new file mode 100644 index 0000000000..b130ae7813 --- /dev/null +++ b/test/files/run/t6077_patmat_cse_irrefutable.scala @@ -0,0 +1,13 @@ +class LiteralNode(val value: Any) + +object LiteralNode { + // irrefutable + def unapply(n: LiteralNode) = Some(n.value) +} + +object Test extends App { + ((new LiteralNode(false)): Any) match { + case LiteralNode(true) => println("uh-oh") + case LiteralNode(false) => println("ok") + } +} \ No newline at end of file -- cgit v1.2.3