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

escaped values on their own line cause erroneous compilation error #3617

Closed
coreywoodfield opened this issue Mar 7, 2024 · 3 comments · Fixed by #3624
Closed

escaped values on their own line cause erroneous compilation error #3617

coreywoodfield opened this issue Mar 7, 2024 · 3 comments · Fixed by #3624

Comments

@coreywoodfield
Copy link

coreywoodfield commented Mar 7, 2024

Somewhere between semanticdb version 4.7.8 and 4.8.15, the following bug was introduced. It is also reproducible in 4.9.1.

scala version: 2.13.12

Bug reproduction steps

Attempt to compile the following code with scalac Test.scala -Xplugin:semanticdb-plugin_singlejar.jar -Xsource:3

object Test {
  val `f-oo` = 1
  def bar =
    `f-oo`
}

Note that it fails with

Test.scala:3: error: illegal start of simple expression
  def bar =
           ^

If the newline is removed

object Test {
  val `f-oo` = 1
  def bar = `f-oo`
}

it compiles just fine. If -Xsource:3 or -Xplugin:semanticdb-plugin_singlejar.jar are left off, it compiles fine.

Expected behavior

The semanticdb plugin does not cause compiler errors when run with -Xsource:3 on code that compiles without the plugin

@kitbellew
Copy link
Contributor

@coreywoodfield i don't think this repo defines the semanticdb plugin; therefore, please try to reproduce with scalameta directly and supply the dialect which shows this error.

@tgodzik
Copy link
Collaborator

tgodzik commented Mar 7, 2024

We do publish semanticdb plugin and it uses the same version of scalameta. This looks like one of the issues already reported, no?

@kitbellew
Copy link
Contributor

We do publish semanticdb plugin and it uses the same version of scalameta.

oh, didn't realize that.

This looks like one of the issues already reported, no?

possibly, need to test. backquoted id can be a leading infix, and in the form presented here was fixed in 4.9.1 (if what's reproducible in 4.9.1 is exactly this). if, however, it comes with a trailing blank line, it's the same issue as what #3606 fixed.

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

Successfully merging a pull request may close this issue.

3 participants