Closed vasilmkd closed 4 months ago
When I try this on the command line i get the desired formatting (using 2.13.13). How did you run the compiler?
➜ sandbox cat A.scala
trait T { def f: Object }
class K extends T { val f = "" }
➜ sandbox sc A.scala -Xsource:3 -quickfix:any
A.scala:2: error: [rewritten by -quickfix] under -Xsource:3-cross, the inferred type changes to Object instead of String
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, site=K.f
class K extends T { val f = "" }
^
1 error
➜ sandbox cat A.scala
trait T { def f: Object }
class K extends T { val f: String = "" }
➜ sandbox
Hmmm, maybe I got confused earlier today. Indeed I only reproduce the problem on Scala 2.13.12 with the same Scala source and the following scalac invocation:
scalac A.scala -Xsource:3 -quickfix:any
Yesterday, I nearly commented on a dotty ticket before noticing that I'd make a mistake somewhere in compile/run/version. (scala-cli was also involved as a complication.)
I would like a shell mode where it tracks exactly what I tried and in what order and also captures outputs.
It worked a bit to use -Dscala.repl.info
so repl transcript shows the version.
Reproduction steps
Scala version: 2.13.12 and 2.13.13
Compiler output:
Problem
Applying the quickfix produces the following source code:
A nicer formatting would be: