Skip to content

Commit f25adb9

Browse files
committed
No warn param of overriding method
1 parent 8a99f9f commit f25adb9

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

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

+1
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,7 @@ object CheckUnused:
580580
end checkExplicit
581581
// begin
582582
if !infos.skip(m)
583+
&& !m.nextOverriddenSymbol.exists
583584
&& !allowed
584585
then
585586
checkExplicit()

tests/warn/i22742.scala

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//> using options -Wunused:all -Werror
2+
3+
trait Foldable[F[_]]:
4+
def foldLeft[A, B](fa: F[A], b: B)(f: (B, A) => B): B
5+
6+
type Id[A] = A
7+
8+
given foldableId: Foldable[Id] =
9+
new Foldable[Id]:
10+
def foldLeft[A, B](fa: Id[A], b: B)(f: (B, A) => B): B = b

0 commit comments

Comments
 (0)