From d51d08b444e0ea4a2c13b4daf0ce14b53bfbad89 Mon Sep 17 00:00:00 2001 From: Samuel Gruetter Date: Wed, 19 Mar 2014 17:53:49 +0100 Subject: move all tests in tests/untried/neg which use implicits to tests/untried/neg-with-implicits --- .../untried/neg-with-implicits/divergent-implicit.scala | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/untried/neg-with-implicits/divergent-implicit.scala (limited to 'tests/untried/neg-with-implicits/divergent-implicit.scala') diff --git a/tests/untried/neg-with-implicits/divergent-implicit.scala b/tests/untried/neg-with-implicits/divergent-implicit.scala new file mode 100644 index 000000000..4a356d54f --- /dev/null +++ b/tests/untried/neg-with-implicits/divergent-implicit.scala @@ -0,0 +1,16 @@ +object Test1 { + implicit def cast[A, B](x: A)(implicit c: A => B): B = c(x) + + val x1: String = 1 + val x2: String = cast[Int, String](1) +} +object Test2 { + class Foo + class Bar + class Baz + implicit def foo2bar(x: Foo)(implicit baz2bar: Baz => Bar): Bar = baz2bar(new Baz) + implicit def baz2bar(x: Baz)(implicit foo2bar: Foo => Bar): Bar = foo2bar(new Foo) + + val x: Bar = new Foo + val y: Bar = new Baz +} -- cgit v1.2.3