aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-10-30 19:11:19 +0100
committerMartin Odersky <odersky@gmail.com>2015-10-30 19:11:23 +0100
commitb80b179d6fbb92c8f6ff3616cec1f3aab5106799 (patch)
tree3c22873902406337024eaa00ff51189405f22ad6 /tests
parent9fbb9c9c9b6050183dd71b8541a63fc6ebf9e2a6 (diff)
downloaddotty-b80b179d6fbb92c8f6ff3616cec1f3aab5106799.tar.gz
dotty-b80b179d6fbb92c8f6ff3616cec1f3aab5106799.tar.bz2
dotty-b80b179d6fbb92c8f6ff3616cec1f3aab5106799.zip
Also handle SAM functions when adaptiing arity of case lambdas.
Diffstat (limited to 'tests')
-rw-r--r--tests/pos/i873.scala6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/pos/i873.scala b/tests/pos/i873.scala
index 71c8a3959..94f8d2c67 100644
--- a/tests/pos/i873.scala
+++ b/tests/pos/i873.scala
@@ -1,4 +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
}