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

Warning causing evaluation to fail #747

Open
tgodzik opened this issue May 13, 2024 · 4 comments
Open

Warning causing evaluation to fail #747

tgodzik opened this issue May 13, 2024 · 4 comments

Comments

@tgodzik
Copy link
Collaborator

tgodzik commented May 13, 2024

I am getting:

compilation failed:
parentheses are required around the parameter of a lambda
Use '-Wconf:msg=lambda-parens:s' to silence this warning. [quickfixable]
Scala 3 migration messages are errors under -Xsource:3. Use -Wconf / @nowarn to filter them or add -Xmigration to demote them to warnings.
Applicable -Wconf / @nowarn filters for this fatal warning: msg=<part of the message>, cat=scala3-migration

though the workspace doesn't use -Xsource:3

Maybe we could at least silence the warning?

@tgodzik tgodzik transferred this issue from scalacenter/bloop Aug 16, 2024
@tgodzik
Copy link
Collaborator Author

tgodzik commented Aug 16, 2024

I realized I created the issue in Bloop 🤦‍♂️

The issue I had was that expression evaluation was failing in a file which had potential warning when adding -Xsource:3. Do we add that flag by default?

@adpi2
Copy link
Member

adpi2 commented Aug 19, 2024

Yes, if it is a Scala 2 entry it seems we had the -Xsource:3 option.

val optionsToAdd = if (entry.isScala2) defaultScala2Options else Seq.empty

The reason for this is to be able to evaluate expressions in Scala 2 libraries. We don't know what were there compiler options, but it is likely that they use -Xsource:3 for cross-compilation.

I see 2 possibilities to fix this issue:

  1. If it's a module, instead of a library, we don't add any option.
  2. Or we remove -Xfatal-warnings from the expression compiler options.

I think I prefer solution 2 because, in mixed Scala 2 - Scala 3 projects, we also need to add -Xtasty-reader to evaluate Scala 3 symbols in Scala 2 expressions.

@tgodzik
Copy link
Collaborator Author

tgodzik commented Aug 19, 2024

Or we remove -Xfatal-warnings from the expression compiler options.

Though isn't the warning fatal by default with -Xsource:3 from what I see? https://docs.scala-lang.org/scala3/guides/migration/tooling-scala2-xsource3.html

Maybe we need to change to -Xsource:3-cross ?

@adpi2
Copy link
Member

adpi2 commented Aug 19, 2024

Though isn't the warning fatal by default with -Xsource:3 from what I see?

Yes you're right. Then maybe adding -Xmigration will help.

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