Skip to content

-Xprint prints octal escape literals in strings #13183

@ansvonwa

Description

@ansvonwa

"they were deprecated for ages in Scala 2 and were dropped in 2.13"

Compiler version

3.0.0, 3.0.3-RC1-bin-20210727-b902516-NIGHTLY

Minimized code

$ scala3 -Xprint:typer
scala> "\u001b"                                                                                                                                                                                                 

Output

$ scala3 -Xprint:typer
scala> "\u001b"                                                                                                                                                                                                    
result of rs$line$1 after typer:
package <empty> {
  final lazy module val rs$line$1: rs$line$1$ = new rs$line$1$()
  final module class rs$line$1$() extends Object() { this: rs$line$1.type =>
    val res0: String = "\033"
  }
}
val res0: String = 

BUT:
scala> "\033"                                                                                                                                                                                                 
1 |"\033"
  | ^
  | octal escape literals are unsupported: use \u001b instead

Expectation

$ scala3 -Xprint:typer
scala> "\u001b"                                                                                                                                                                                                    
result of rs$line$1 after typer:
package <empty> {
  final lazy module val rs$line$1: rs$line$1$ = new rs$line$1$()
  final module class rs$line$1$() extends Object() { this: rs$line$1.type =>
    val res0: String = "\u001b"
  }
}
val res0: String = 

Metadata

Metadata

Assignees

Labels

SpreeSuitable for a future Spreegood first issuePerfect for someone who wants to get started contributingitype:bugprio:low

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions