From 52e47dedeecdeb550ce8a1ac6f7327c733c5f6ff Mon Sep 17 00:00:00 2001 From: Jamie Thompson Date: Fri, 10 Sep 2021 11:01:06 +0200 Subject: [PATCH] fix #13497: add regression test --- tests/neg/i13497.scala | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 tests/neg/i13497.scala 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] + } + }