diff options
Diffstat (limited to 'test')
-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) +} |