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

Fix warning injected into user code by @chiselName #2500

Merged
merged 1 commit into from
Apr 25, 2022

Conversation

jackkoenig
Copy link
Contributor

@jackkoenig jackkoenig commented Apr 22, 2022

In Scala 2.13, Auto-application to () is deprecated. Any nullary
method (ie. a method with no arguments) that is defined with () must now
be called with (). @chiselName used to inject a case of this warning
into user code which would then cause a warning on the @chiselName macro
that the user has no way to fix.

To see this warning, compile Chisel with Scala 2.13, you'll see something like:

[warn] .../chisel3/src/main/scala/chisel3/util/Arbiter.scala:119:2: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method length,
[warn] or remove the empty argument list from its definition (Java-defined methods are exempt).
[warn] In Scala 3, an unapplied method like this will be eta-expanded into a function.
[warn] @chiselName
[warn]  ^
[warn] .../chisel3/src/main/scala/chisel3/util/Arbiter.scala:135:2: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method length,
[warn] or remove the empty argument list from its definition (Java-defined methods are exempt).
[warn] In Scala 3, an unapplied method like this will be eta-expanded into a function.
[warn] @chiselName
[warn]  ^
[warn] two warnings found

This changes fixes this bug.

Contributor Checklist

  • Did you add Scaladoc to every public function/method?
  • Did you add at least one test demonstrating the PR?
  • Did you delete any extraneous printlns/debugging code?
  • Did you specify the type of improvement?
  • Did you add appropriate documentation in docs/src?
  • Did you state the API impact?
  • Did you specify the code generation impact?
  • Did you request a desired merge strategy?
  • Did you add text to be included in the Release Notes for this change?

Type of Improvement

  • bug fix

API Impact

No impact

Backend Code Generation Impact

No impact

Desired Merge Strategy

  • Squash

Release Notes

Fix Scala 2.13 warning "Auto-application to () is deprecated." when using @chiselName in user code.

Reviewer Checklist (only modified by reviewer)

  • Did you add the appropriate labels?
  • Did you mark the proper milestone (Bug fix: 3.4.x, [small] API extension: 3.5.x, API modification or big change: 3.6.0)?
  • Did you review?
  • Did you check whether all relevant Contributor checkboxes have been checked?
  • Did you mark as Please Merge?

In Scala 2.13, Auto-application to `()` is deprecated. Any nullary
method (ie. a method with no arguments) that is defined with () must now
be called with (). @chiselName used to inject a case of this warning
into user code which would then cause a warning on the @chiselName macro
that the user has no way to fix.
@jackkoenig jackkoenig added this to the 3.5.x milestone Apr 22, 2022
@jackkoenig
Copy link
Contributor Author

I think CI is failing due to chipsalliance/treadle#407

@ekiwi
Copy link
Contributor

ekiwi commented Apr 23, 2022

I think CI is failing due to chipsalliance/treadle#407

Yes. I think we need to rebuild and republish everything against the new version of the JSON library in the correct order.

@jackkoenig jackkoenig merged commit ca90268 into master Apr 25, 2022
@jackkoenig jackkoenig deleted the fix-autoapplication-warning-in-chiselname branch April 25, 2022 17:53
mergify bot pushed a commit that referenced this pull request Apr 25, 2022
In Scala 2.13, Auto-application to `()` is deprecated. Any nullary
method (ie. a method with no arguments) that is defined with () must now
be called with (). @chiselName used to inject a case of this warning
into user code which would then cause a warning on the @chiselName macro
that the user has no way to fix.

(cherry picked from commit ca90268)
@mergify mergify bot added the Backported This PR has been backported label Apr 25, 2022
@jackkoenig
Copy link
Contributor Author

Yes. I think we need to rebuild and republish everything against the new version of the JSON library in the correct order.

All that was needed it seems was treadle. I've republished it's SNAPSHOTs.

mergify bot added a commit that referenced this pull request Apr 25, 2022
In Scala 2.13, Auto-application to `()` is deprecated. Any nullary
method (ie. a method with no arguments) that is defined with () must now
be called with (). @chiselName used to inject a case of this warning
into user code which would then cause a warning on the @chiselName macro
that the user has no way to fix.

(cherry picked from commit ca90268)

Co-authored-by: Jack Koenig <koenig@sifive.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backported This PR has been backported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants