From 64c57631ab64308327504a56a27a74630b22f434 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Fri, 25 May 2012 23:20:40 +0200 Subject: Test case closes SI-4818 Fixed between 2.10.0 M2 and M3, with both the old and new pattern matcher. --- test/files/neg/t4818.check | 6 ++++++ test/files/neg/t4818.scala | 7 +++++++ 2 files changed, 13 insertions(+) create mode 100644 test/files/neg/t4818.check create mode 100644 test/files/neg/t4818.scala (limited to 'test') diff --git a/test/files/neg/t4818.check b/test/files/neg/t4818.check new file mode 100644 index 0000000000..a5e15e456b --- /dev/null +++ b/test/files/neg/t4818.check @@ -0,0 +1,6 @@ +t4818.scala:4: error: type mismatch; + found : Int(5) + required: Nothing + def f(x: Any) = x match { case Fn(f) => f(5) } + ^ +one error found diff --git a/test/files/neg/t4818.scala b/test/files/neg/t4818.scala new file mode 100644 index 0000000000..faae229206 --- /dev/null +++ b/test/files/neg/t4818.scala @@ -0,0 +1,7 @@ +object Test { + case class Fn[A, B](f: A => B) + + def f(x: Any) = x match { case Fn(f) => f(5) } + + Fn((x: String) => x) +} -- cgit v1.2.3