Closed soufianexmx closed 2 months ago
Same here. Reproduces both with Scala 2.13.10 and 3.2.2
presumably this started with https://github.com/com-lihaoyi/fastparse/pull/281
we get compilation error
well, presumably just a warning, that you have yourself promoted to an error with -Werror
?
if someone is looking for a workaround, I think "@nowarn
annotation does not suppress any warning" is itself a warning that can be suppressed with @nowarn
?
I tried to add @nowarn("msg=@nowarn annotation does not suppress any warnings")
(or generic @nowarn) at the class and method using macro level, and it does not suppress the warning (and add a new @nowarn annotation does not suppress any warnings
)
I wasn't able to find an other way than disabling useless nowarn warning with -Wconf:cat=unused-nowarn:s
(see https://www.scala-lang.org/api/current/scala/annotation/nowarn.html).
I would prefer that scalac don't report nowarn inside macro, because as the user of the macro, I can't do anything about them.
So, one can selectively silent the problematic warning on specific file but keep them for other files with combined filter.
For ex:
-Wconf:cat=unused-nowarn&src=com/normation/utils/Version.scala:s,cat=unused-nowarn&src=com/normation/rudder/services/policies/InterpolatedValueCompiler.scala:s
Will silent the @nowarn annotation does not suppress any warnings
warnings in com/normation/utils/Version.scala
and com/normation/rudder/services/policies/InterpolatedValueCompiler.scala
, but keep them in other files.
More info with scala -Wconf:help
This is good enought for the time being for me.
Somehow I'm not able to reproduce this inside my test suite. Would appreciate any help if someone wants to look into this inside the Fastparse repo and come up with a repro
@lihaoyi I don't know if this is related, but here's the error I got for 2.13.1 (and only that version): https://github.com/scalameta/scalameta/actions/runs/5503580335/jobs/10028930479?pr=3246
Maybe it's specific to particular Scala versions? @soufianexmx @limansky @fanf what Scala versions are you guys seeing this in?
2.13.10 for me I think.
We first saw it in 2.13.10, and I checked it's still the case in 2.13.11
@lihaoyi I've tried with both 2.13.10 and 2.13.11. It looks like you have to have -Xlint
in your scalacOptions.
Ah I think it must be the -Xlint
flag that I've been missing
@lihaoyi Hi, I've checked 3.0.2 and the issue is still there. Please let me know if you need minimal example to demonstrate the problem.
I'm using Fastparse too in a Java project, I would like to give this a try, this weekend.
@He-Pin please go ahead!
Should be fixed by https://github.com/com-lihaoyi/fastparse/pull/310
👏
Using Scala 2.13, after upgrading to version 3.0.1, for a code like:
we get compilation error:
Haoyi: To incentivize contribution, I'm putting a 200USD bounty on resolving this ticket. This is payable via bank transfer, and at my discretion in case of ambiguity. The acceptance criteria is a PR fixing this issue and updates to our test infrastructure to validate the fix