Skip to content

Commit

Permalink
Warn for synthetic using/givens with wunused
Browse files Browse the repository at this point in the history
  • Loading branch information
szymon-rd committed Mar 28, 2023
1 parent 97bdd0d commit 59fb54d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/transform/CheckUnused.scala
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ object CheckUnused:
if ctx.settings.WunusedHas.implicits then
implicitParamInScope
.filterNot(d => d.symbol.usedDefContains)
.filterNot(d => containsSyntheticSuffix(d.symbol))
.filterNot(d => containsSyntheticSuffix(d.symbol) && !d.rawMods.is(Given))
.map(d => d.namePos -> WarnTypes.ImplicitParams).toList
else
Nil
Expand Down
2 changes: 1 addition & 1 deletion tests/neg-custom-args/fatal-warnings/i15503f.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ val default_int = 1

def f1(a: Int) = a // OK
def f2(a: Int) = 1 // OK
def f3(a: Int)(using Int) = a // OK
def f3(a: Int)(using Int) = a // error
def f4(a: Int)(using Int) = default_int // error
def f6(a: Int)(using Int) = summon[Int] // OK
def f7(a: Int)(using Int) = summon[Int] + a // OK
Expand Down

0 comments on commit 59fb54d

Please sign in to comment.