Skip to content

Commit d07da8b

Browse files
committed
Add test showing use of @nowarn
1 parent 5eceb36 commit d07da8b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/pos/given-loop-prevention.scala

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//> using options -Xfatal-warnings
2+
3+
class Foo
4+
5+
object Bar {
6+
given Foo with {}
7+
given List[Foo] = List(summon[Foo]) // ok
8+
}
9+
10+
object Baz {
11+
@annotation.nowarn
12+
given List[Foo] = List(summon[Foo]) // gives a warning, which is suppressed
13+
given Foo with {}
14+
}

0 commit comments

Comments
 (0)