From 840def7dcd6403b594f8021c5be5104b688aab6e Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sun, 28 Jul 2019 16:14:07 +0200 Subject: [PATCH] Fix #6716: Add test --- tests/pos/i6716.scala | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/pos/i6716.scala diff --git a/tests/pos/i6716.scala b/tests/pos/i6716.scala new file mode 100644 index 000000000000..12a4903d2a7c --- /dev/null +++ b/tests/pos/i6716.scala @@ -0,0 +1,15 @@ +trait Monad[T] +class Foo +object Foo { + given as Monad[Foo] +} + +opaque type Bar = Foo +object Bar { + given as Monad[Bar] = the[Monad[Foo]] +} + +object Test { + val mf = the[Monad[Foo]] + val mb = the[Monad[Bar]] +} \ No newline at end of file