From 9cb35429fc2c52f5d243b9c9d29739df1ff5967a Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 22 Oct 2015 13:19:14 +0200 Subject: Fix #830: Compiler hangs on implicit search with singleton &/| In fact we get a deep subtype recursion when compileing i830.scala. The problem goes away once we make use of the fact that the intersection of two singleton types which are not subtypes of each other is empty. --- tests/pos/i830.scala | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 tests/pos/i830.scala (limited to 'tests/pos') diff --git a/tests/pos/i830.scala b/tests/pos/i830.scala new file mode 100644 index 000000000..8fcb29f36 --- /dev/null +++ b/tests/pos/i830.scala @@ -0,0 +1,6 @@ +object C { + trait X[T] + implicit def u[A, B]: X[A | B] = new X[A | B] {} + def y[T](implicit x: X[T]): T = ??? + val x: 1 & 2 | 2 & 3 = y +} -- cgit v1.2.3