diff --git a/tests/neg/i13497.scala b/tests/neg/i13497.scala new file mode 100644 index 000000000000..83f1cd7519b9 --- /dev/null +++ b/tests/neg/i13497.scala @@ -0,0 +1,13 @@ +trait Foo +trait Bar +object Foo: + given (using Bar): Foo = ??? + +object Bug: + def demonstrate: Unit = + Option.empty[Unit].flatMap { _ => + Option.empty[Unit].map { _ => + val foo = summon[Foo] // error: Foo.given_Foo(/* missing */summon[Bar]) + Option.empty[Unit] + } + }