diff options
author | odersky <odersky@gmail.com> | 2015-11-02 14:48:16 +0100 |
---|---|---|
committer | odersky <odersky@gmail.com> | 2015-11-02 14:48:16 +0100 |
commit | f58acd171105487984a1d8df2646246aab43e5e1 (patch) | |
tree | f271a3ece981ef0df425d21a98bdc913adaee876 /tests | |
parent | 21f6711d0ba034238f780614368d9d270192a22a (diff) | |
parent | b80b179d6fbb92c8f6ff3616cec1f3aab5106799 (diff) | |
download | dotty-f58acd171105487984a1d8df2646246aab43e5e1.tar.gz dotty-f58acd171105487984a1d8df2646246aab43e5e1.tar.bz2 dotty-f58acd171105487984a1d8df2646246aab43e5e1.zip |
Merge pull request #887 from dotty-staging/fix-#873
Allow pattern matching anonymous functions of arity > 1
Diffstat (limited to 'tests')
-rw-r--r-- | tests/pos/i873.scala | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/pos/i873.scala b/tests/pos/i873.scala new file mode 100644 index 000000000..94f8d2c67 --- /dev/null +++ b/tests/pos/i873.scala @@ -0,0 +1,10 @@ +object Test { + def call(k: (Int, Int) => Unit): Unit = ??? + def test = call({ case (x, y) => ()}) + + trait X extends Function1[Int, String] + implicit def f2x(f: Function1[Int, String]): X = ??? + ({case _ if "".isEmpty => ""} : X) // allowed, implicit view used to adapt + + // ({case _ if "".isEmpty => 0} : X) // expected String, found Int +} |