You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue is reproducible starting with Scala v3.7.x: 3.7.0, 3.7.1 as well as 3.7.2-RC1-bin-20250609-41cf6eb-NIGHTLY.
It does not appear in Scala v3.3.x and v3.6.x.
Minimized code
//>usingscala3.7.nightly//>usingoptions-Wunused:explicits// An external class that doesn't get its own `copy` method.classFoo(vala:String, valb:Int)
//// Example 1: add `copy` method via an extension method.//extension (self: Foo)
defcopy(a: String= self.a, b: Int= self.b):Foo=Foo(a, b)
//// Example 2: implement `copyFoo` with parameter groups.//defcopyFoo(foo: Foo)(a: String= foo.a, b: Int= foo.b):Foo=Foo(a, b)
Output
Starting with Scala v3.7.x only:
-- [E198] Unused Symbol Warning: .../unused-explicit-param.scala:10:11
10 |extension (self: Foo)
| ^^^^
| unused explicit parameter in extension method copy
-- [E198] Unused Symbol Warning: .../unused-explicit-param.scala:16:12
16 |def copyFoo(foo: Foo)(a: String = foo.a, b: Int = foo.b): Foo = Foo(a, b)
| ^^^
| unused explicit parameter
2 warnings found
No warnings in Scala v3.6.4 and v3.3.6.
Expectation
No warning whatsoever.
The text was updated successfully, but these errors were encountered:
satorg
changed the title
Probably regression in v3.7.x: false positive warning with -Wunused:explicit
Probably regression in v3.7.x: false positive warning with -Wunused:explicitsJun 10, 2025
Compiler version
The issue is reproducible starting with Scala v3.7.x: 3.7.0, 3.7.1 as well as 3.7.2-RC1-bin-20250609-41cf6eb-NIGHTLY.
It does not appear in Scala v3.3.x and v3.6.x.
Minimized code
Output
Starting with Scala v3.7.x only:
No warnings in Scala v3.6.4 and v3.3.6.
Expectation
No warning whatsoever.
The text was updated successfully, but these errors were encountered: