From 27081ae59ba5b00b6ae05bb3cdd9c3ff7db0a28e Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 7 May 2014 19:09:52 +0200 Subject: Tests pos/23xx to 24xx. --- tests/pos/t2305.scala | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tests/pos/t2305.scala (limited to 'tests/pos/t2305.scala') diff --git a/tests/pos/t2305.scala b/tests/pos/t2305.scala new file mode 100644 index 000000000..3338ab911 --- /dev/null +++ b/tests/pos/t2305.scala @@ -0,0 +1,26 @@ +import java.util.ArrayList + +trait Bind[Z[_]] + +class MySerializable[X] extends java.io.Serializable + +object Bind { + implicit val JavaArrayListBind: Bind[ArrayList] = new Bind[ArrayList] {} + implicit val MySerializableBind: Bind[MySerializable] = new Bind[MySerializable] {} +} + +object works { + // this works fine: + def runbind(implicit bind: Bind[MySerializable]): Unit = {} + runbind +} + +object breaks { + def runbind(implicit bind: Bind[ArrayList]): Unit = {} + runbind + /*java.lang.AssertionError: assertion failed: java.io.Serializable + at scala.Predef$.assert(Predef.scala:107) + at scala.tools.nsc.symtab.Types$TypeRef.transform(Types.scala:1417) + at scala.tools.nsc.symtab.Types$TypeRef.baseType(Types.scala:1559) + */ +} -- cgit v1.2.3