File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -614,6 +614,7 @@ object CheckUnused:
614614 || sym.info.isInstanceOf [RefinedType ] // can't be expressed as a context bound
615615 if ctx.settings.WunusedHas .implicits
616616 && ! infos.skip(m)
617+ && ! m.nextOverriddenSymbol.exists
617618 && ! allowed
618619 then
619620 if m.isPrimaryConstructor then
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ object ExampleWithoutWith:
4242 case ' { $ {Expr (opt)} : Some [T ] } => Some (opt)
4343 case _ => None
4444
45- // absolving names on matches of quote trees requires consulting non-abstract types in QuotesImpl
45+ // nowarning names on matches of quote trees requires consulting non-abstract types in QuotesImpl
4646object Unmatched :
4747 import scala .quoted .*
4848 def transform [T ](e : Expr [T ])(using Quotes ): Expr [T ] =
@@ -84,3 +84,18 @@ package givens:
8484 given namely : (x : X ) => Y : // warn protected param to given class
8585 def doY = " 8"
8686end givens
87+
88+ object i22895 :
89+ trait Test [F [_], Ev ] {
90+ def apply [A , B ](fa : F [A ])(f : A => B )(using ev : Ev ): F [B ]
91+ }
92+ given testId : Test [[a] =>> a, Unit ] =
93+ new Test [[a] =>> a, Unit ] {
94+ def apply [A , B ](fa : A )(f : A => B )(using ev : Unit ): B = f(fa) // nowarn override
95+ }
96+ class C :
97+ def f (using s : String ) = s.toInt
98+ class D (i : Int ) extends C :
99+ override def f (using String ) = compute(i) // nowarn override
100+ def g (using sss : String ) = compute(i) // warn
101+ def compute (i : Int ) = i * 42 // returning a class param is deemed trivial, make it non-trivial
You can’t perform that action at this time.
0 commit comments