Skip to content
New issue

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

Invalid "never used" warnings with Scala 2.13.9 #12655

Closed
gaeljw opened this issue Sep 26, 2022 · 2 comments
Closed

Invalid "never used" warnings with Scala 2.13.9 #12655

gaeljw opened this issue Sep 26, 2022 · 2 comments

Comments

@gaeljw
Copy link

gaeljw commented Sep 26, 2022

Reproduction steps

Scala version: 2.13.9

Upgrading from Scala 2.13.8 to 2.13.9 leads to code incorrectly identified as "non used".

I didn't set up a reproduction repo yet but could provide one later if needed.

My current reproduction code is in test scope:

trait SomeTrait extends Matchers {

  var something: SomeCaseClass = _

  def foo() = {
    something.x mustEqual true
  }

}

And the error message (warnings raised as errors):

[error] ....scala:16:7: parameter value something_= in variable something is never used
[error]   var something: SomeCaseClass = _

Problem

This variable is definitely used, there's no reason to see it as not used.

Also the error message is a bit weird with this appended underscore, isn't it? 🤔

@He-Pin
Copy link
Contributor

He-Pin commented Sep 26, 2022

#12646

@gaeljw
Copy link
Author

gaeljw commented Sep 26, 2022

Thanks @He-Pin , I hadn't see the duplicate!

@gaeljw gaeljw closed this as completed Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants