Skip to content

quickfixes don't include escapes when needed #12942

Open
@coreywoodfield

Description

@coreywoodfield

Reproduction steps

Scala version: 2.13.12

In Test.scala:

trait Trait {
  def foo: Any
}
class Test extends Trait{
  case object `val`

  override def foo = `val`
}

When you run scalac -quickfix:any -Xsource:3 Test.scala, the file gets updated to

trait Trait {
  def foo: Any
}
class Test extends Trait{
  case object `val`

  override def foo: Test.this.val.type = `val`
}

which does not compile (the val in the type should be surrounded with backticks)

Problem

Quickfixes should escape keywords as needed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions