Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Warning: @deprecated("Use JavaTests instead", since = "Mill 0.11.10") #3371

Closed
james-s-w-clark opened this issue Aug 15, 2024 · 1 comment · Fixed by #3379
Closed

Warning: @deprecated("Use JavaTests instead", since = "Mill 0.11.10") #3371

james-s-w-clark opened this issue Aug 15, 2024 · 1 comment · Fixed by #3379
Milestone

Comments

@james-s-w-clark
Copy link
Contributor

james-s-w-clark commented Aug 15, 2024

I just upgraded to mill 0.11.11, and see a warning for trait JavaModuleTests in trait JavaModule is deprecated even though our project isn't using that deprecated trait (JavaModuleTests).

I also saw this warning in a recent issue (#3359 (comment)), so I figured the warning may come from mill itself.

I think it's coming from the first line here:

  type JavaTests = JavaModuleTests
  @deprecated("Use JavaTests instead", since = "Mill 0.11.10")
  trait JavaModuleTests extends JavaModule with TestModule {

https://github.com/com-lihaoyi/mill/blob/main/scalalib/src/mill/scalalib/JavaModule.scala#L39-L41

It can be reproduced on main with e.g. ./mill -i dev.run anything, even if you update all JavaModuleTests to JavaTests.

I had a try with some @nowarns on the non-deprecated type in the repo, and removing references to the deprecated JavaModuleTests, but didn't manage to fix it. It looks like it could help though (quick check in Scastie), but no luck trying it in the actual repo:

image

image

(Tangent: somehow our -Xfatal-warnings aren't triggered by the warning, so that's good - but we might just have something misconfigured 😅 )

@tculshaw
Copy link

Same here. I reverted to 0.11.9 for now.

@lefou lefou added this to the 0.12.0 milestone Aug 18, 2024
lolgab pushed a commit to lolgab/mill that referenced this issue Aug 20, 2024
…ihaoyi#3379)

Fixes com-lihaoyi#3371

The direct problem is that we are generating code with resolved type
aliases, resulting in the `JavaTests` aliases being resolved to
deprecated `JavaModuleTests` traits. However, in general generated code
should probably not display warnings at all, so better to just slap
`@nowarn` on the whole chunk rather than trying to fix the immediate
alias resolution problem
lolgab added a commit that referenced this issue Aug 20, 2024
#3400)

Fixes #3371

The direct problem is that we are generating code with resolved type
aliases, resulting in the `JavaTests` aliases being resolved to
deprecated `JavaModuleTests` traits. However, in general generated code
should probably not display warnings at all, so better to just slap
`@nowarn` on the whole chunk rather than trying to fix the immediate
alias resolution problem

Pull Request: #3400

Co-authored-by: Li Haoyi <haoyi.sg@gmail.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants