diff --git a/tests/run/i13691b.scala b/tests/run/i13691b.scala new file mode 100644 index 000000000000..1da726827467 --- /dev/null +++ b/tests/run/i13691b.scala @@ -0,0 +1,12 @@ +// https://github.com/lampepfl/dotty/issues/13691 +import language.experimental.saferExceptions + +trait Decoder[+T]: + def apply(): T + +given Decoder[Int throws Exception] = new Decoder[Int throws Exception]: + def apply(): Int throws Exception = 1 + +@main def Test(): Unit = + import unsafeExceptions.canThrowAny + summon[Decoder[Int throws Exception]]()