Skip to content

Commit

Permalink
Add test showing use of @nowarn
Browse files Browse the repository at this point in the history
  • Loading branch information
odersky committed Jan 8, 2024
1 parent 5eceb36 commit d07da8b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/pos/given-loop-prevention.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//> using options -Xfatal-warnings

class Foo

object Bar {
given Foo with {}
given List[Foo] = List(summon[Foo]) // ok
}

object Baz {
@annotation.nowarn
given List[Foo] = List(summon[Foo]) // gives a warning, which is suppressed
given Foo with {}
}

0 comments on commit d07da8b

Please sign in to comment.