diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2012-05-25 23:20:40 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2012-05-25 23:22:20 +0200 |
commit | 64c57631ab64308327504a56a27a74630b22f434 (patch) | |
tree | 38d40e3a10cfaf2004c86fbb6e9b8dd845da85b0 /test/files | |
parent | 123050cf07229d02789dc42e27a85c93fd9343a4 (diff) | |
download | scala-64c57631ab64308327504a56a27a74630b22f434.tar.gz scala-64c57631ab64308327504a56a27a74630b22f434.tar.bz2 scala-64c57631ab64308327504a56a27a74630b22f434.zip |
Test case closes SI-4818
Fixed between 2.10.0 M2 and M3, with both the old and new pattern matcher.
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/neg/t4818.check | 6 | ||||
-rw-r--r-- | test/files/neg/t4818.scala | 7 |
2 files changed, 13 insertions, 0 deletions
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) +} |