File tree 2 files changed +17
-1
lines changed
compiler/src/dotty/tools/dotc/transform
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -614,6 +614,7 @@ object CheckUnused:
614
614
|| sym.info.isInstanceOf [RefinedType ] // can't be expressed as a context bound
615
615
if ctx.settings.WunusedHas .implicits
616
616
&& ! infos.skip(m)
617
+ && ! m.nextOverriddenSymbol.exists
617
618
&& ! allowed
618
619
then
619
620
if m.isPrimaryConstructor then
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ object ExampleWithoutWith:
42
42
case ' { $ {Expr (opt)} : Some [T ] } => Some (opt)
43
43
case _ => None
44
44
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
46
46
object Unmatched :
47
47
import scala .quoted .*
48
48
def transform [T ](e : Expr [T ])(using Quotes ): Expr [T ] =
@@ -84,3 +84,18 @@ package givens:
84
84
given namely : (x : X ) => Y : // warn protected param to given class
85
85
def doY = " 8"
86
86
end 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