From ac031789039d421186567cf3b9a484957e6e5f8e Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 22 Nov 2011 18:07:51 +0000 Subject: Compiler part of fast orElse. "According to the spec this code should not be legal. Disabling for now." Need to come back and either make it work or (more likely) make nsc reject the test) --- test/disabled/pos/t1545.scala | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 test/disabled/pos/t1545.scala (limited to 'test/disabled') diff --git a/test/disabled/pos/t1545.scala b/test/disabled/pos/t1545.scala new file mode 100755 index 0000000000..4c5908b8a1 --- /dev/null +++ b/test/disabled/pos/t1545.scala @@ -0,0 +1,18 @@ +// According to the spec this code should not be legal. +// Disabling for now. +object Main extends App { + + case class Foo (field : Option[String]) + + val x : PartialFunction[Foo,Int] = + { + c => c.field match { + case Some (s) => 42 + case None => 99 + } + } + + println (x (Foo (None))) // prints 99 + println (x (Foo (Some ("foo")))) // prints 42 + +} -- cgit v1.2.3