From 4619393a6c3b52127ceec07e2fc3630d22aef51a Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 15 Dec 2015 17:46:39 +0100 Subject: Categorize more tests All pos tests up to 3999 have been triaged. One new test in pending. --- tests/pos/t3079.scala | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/pos/t3079.scala (limited to 'tests/pos/t3079.scala') diff --git a/tests/pos/t3079.scala b/tests/pos/t3079.scala new file mode 100644 index 000000000..b7bd63190 --- /dev/null +++ b/tests/pos/t3079.scala @@ -0,0 +1,17 @@ +sealed trait Identity[A] { + val value: A +} + +trait Coerce[A, B] { + def unwrap: (A => B) +} + +object Coerce { + def IdentityCoerce[B] = new Coerce[Identity[B], B] { + // java.lang.Error: A in trait Identity cannot be instantiated from ?x$1.type + def unwrap = _.value + + // Providing the type of _ works around the problem. + //def unwrap = (_: Identity[B]).value + } +} -- cgit v1.2.3