We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3.7.0-RC1-bin-20250306-73ba485-NIGHTLY
With -Wunused:params enabled:
-Wunused:params
import java.time.ZonedDateTime trait Foo[A] { def apply(a: A, t: ZonedDateTime): A } extension [A](a: A)(using f: Foo[A]) { def foo(t: ZonedDateTime = ZonedDateTime.now): A = f(a, t) }
-- [E198] Unused Symbol Warning: /Users/matt/scala3.7-nightly-unused/src/main/scala/example/Test.scala:7:14 ------------ 7 |extension [A](a: A)(using f: Foo[A]) { | ^ | unused explicit parameter -- [E198] Unused Symbol Warning: /Users/matt/scala3.7-nightly-unused/src/main/scala/example/Test.scala:7:26 ------------ 7 |extension [A](a: A)(using f: Foo[A]) { | ^ | unused implicit parameter
Both a and f are used in def foo so they should not be reported unused
a
f
def foo
The text was updated successfully, but these errors were encountered:
I guess because defaults get dependencies they don't use.
def foo$default$3[A >: Nothing <: Any](a: A)(using f: Foo[A]): java.time.ZonedDateTime @uncheckedVariance = java.time.ZonedDateTime.now() }
Sorry, something went wrong.
Ignore params to default arg getters (#22749)
0bbd04f
Fixes #22746 Fixes #22748 Default arg getters are defined with dependencies they don't use.
som-snytt
Successfully merging a pull request may close this issue.
Compiler version
3.7.0-RC1-bin-20250306-73ba485-NIGHTLY
Minimized code
With
-Wunused:params
enabled:Output
Expectation
Both
a
andf
are used indef foo
so they should not be reported unusedThe text was updated successfully, but these errors were encountered: