From e1a18b5d6fcbf00d314f400e3130e23637fba958 Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Mon, 15 Jul 2019 13:49:15 +0200 Subject: [PATCH] Fix #6847: Add regression test --- tests/pos/i6847.scala | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/pos/i6847.scala diff --git a/tests/pos/i6847.scala b/tests/pos/i6847.scala new file mode 100644 index 000000000000..518da6f429d4 --- /dev/null +++ b/tests/pos/i6847.scala @@ -0,0 +1,16 @@ +trait Syntax[F[_]] { + def (a: A) ret[A]: F[A] +} + +trait Instance[A] + +implicit val instanceSyntax: Syntax[Instance] = new Syntax[Instance] { + def (a: A) ret[A]: Instance[A] = new Instance[A] {} +} + +object Instance { + def defer[A](a: => A): Instance[A] = { + ().ret + new Instance[A] {} + } +}