Skip to content

Commit d551be3

Browse files
szymon-rdKordyjan
authored andcommitted
Bring in #17263 to fix the tests.
1 parent d414d3a commit d551be3

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

compiler/src/dotty/tools/dotc/transform/CheckUnused.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class CheckUnused private (phaseMode: CheckUnused.PhaseMode, suffix: String, _ke
118118

119119
override def prepareForDefDef(tree: tpd.DefDef)(using Context): Context =
120120
unusedDataApply{ ud =>
121-
if !tree.rawMods.is(Private) then
121+
if !tree.symbol.is(Private) then
122122
tree.termParamss.flatten.foreach { p =>
123123
ud.addIgnoredParam(p.symbol)
124124
}

tests/neg-custom-args/fatal-warnings/i15503i.scala

-3
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ package foo.test.scala.annotation:
4646
def a1(a: Int) = a // OK
4747
def a2(a: Int) = default_int // ok
4848

49-
private def a2_p(a: Int) = default_int // error
50-
def a2_p_used = a2_p(3)
51-
5249
def a3(@unused a: Int) = default_int //OK
5350

5451
def b1 =

0 commit comments

Comments
 (0)