Skip to content

-Xprint prints octal escape literals in strings #13183

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
ansvonwa opened this issue Jul 28, 2021 · 1 comment · Fixed by #13273
Closed

-Xprint prints octal escape literals in strings #13183

ansvonwa opened this issue Jul 28, 2021 · 1 comment · Fixed by #13273
Assignees
Labels
good first issue Perfect for someone who wants to get started contributing itype:bug prio:low Spree Suitable for a future Spree
Milestone

Comments

@ansvonwa
Copy link
Member

"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 = 
@bishabosha bishabosha added prio:low good first issue Perfect for someone who wants to get started contributing Spree Suitable for a future Spree labels Aug 2, 2021
@bishabosha
Copy link
Member

bishabosha commented Aug 2, 2021

ansvonwa added a commit to ansvonwa/dotty that referenced this issue Aug 9, 2021
fixes scala#13183
Both in -Xprint and in macros, there were octal literals generated. This commit replaces that by unicode.
ansvonwa added a commit to ansvonwa/dotty that referenced this issue Aug 10, 2021
fixes scala#13183
Both in -Xprint and in macros, there were octal literals generated. This commit replaces that by unicode.
olsdavis pushed a commit to olsdavis/dotty that referenced this issue Apr 4, 2022
fixes scala#13183
Both in -Xprint and in macros, there were octal literals generated. This commit replaces that by unicode.
@Kordyjan Kordyjan added this to the 3.1.0 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Perfect for someone who wants to get started contributing itype:bug prio:low Spree Suitable for a future Spree
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants