Skip to content

-explain is only respected when Bloop is disabled with --server=false #1393

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

Closed
Gedochao opened this issue Sep 26, 2022 · 1 comment
Closed
Labels
bug Something isn't working duplicate This issue or pull request already exists SIP-46 All the issues related to SIP-46 to turn Scala CLI into the official scala runner command.

Comments

@Gedochao
Copy link
Contributor

Version(s)
0.1.14

Describe the bug
The -explain compiler flag is not respected by Scala CLI unless passed alongside --server=false (disabling Bloop).

To Reproduce

▶ scala-cli --scala-snippet 'xyz' -O -explain               
Compiling project (Scala 3.2.0, JVM)
[error] <snippet>-scala-snippet:1:1: Illegal start of toplevel definition
Error compiling project (Scala 3.2.0, JVM)
Compilation failed

Known workarounds
Just disable Bloopy by passing --server=false to see the extra compiler info coming from -explain.

▶ scala-cli --scala-snippet 'xyz' -O -explain --server=false
-- [E103] Syntax Error: ~/IdeaProjects/scala-cli-tests/.scala-build/project_fc57e0b39b_fc57e0b39b-4c13fbdfc6/src_generated/main/scala-snippet.scala:1:0 
1 |xyz
  |^^^
  |Illegal start of toplevel definition
  |-----------------------------------------------------------------------------
  | Explanation (enabled by `-explain`)
  |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  | A statement is an import or export, a definition or an expression.
  | Some statements are only allowed in certain contexts
   -----------------------------------------------------------------------------
1 error found
Compilation failed

Expected behaviour
There should be a way to view the extra explanations coming from -explain without disabling Bloop.

@Gedochao Gedochao added bug Something isn't working SIP-46 All the issues related to SIP-46 to turn Scala CLI into the official scala runner command. duplicate This issue or pull request already exists labels Sep 26, 2022
@Gedochao
Copy link
Contributor Author

Just realised we already track this under #1285
Closing this as a duplicate, my bad.

@Gedochao Gedochao closed this as not planned Won't fix, can't repro, duplicate, stale Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists SIP-46 All the issues related to SIP-46 to turn Scala CLI into the official scala runner command.
Projects
None yet
Development

No branches or pull requests

1 participant