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

Decompilation tests sometimes cannot be compiled on Windows due to unicode escapes in comments #5414

Closed
smarter opened this issue Nov 8, 2018 · 2 comments

Comments

@smarter
Copy link
Member

smarter commented Nov 8, 2018

As reported on Gitter by @michelou, the decompilation tests fail on Windows:

-- Error: C:\dotty\out\posTestFromTasty\pos_decompiled\clsrefine\decompiled.scala:28:63 -
28 |/** Decompiled from out\posTestFromTasty\pos\clsrefine\scalac\util\test.class */
   |                                                               ^
   |                                                               error in unicode escape

It's very weird, but Scala will try to interpret a unicode escape \uXXXX when it sees it in a comment. And since Windows paths are separated using \, this means we run into trouble as soon as a directory name starts with u. We can avoid this issue by always using / when printing filenames in comments, even on Windows.

@nicolasstucki
Copy link
Contributor

Always using / seems like a good compromise.

@smarter
Copy link
Member Author

smarter commented Nov 8, 2018

Note that there's a WIP PR to change this behavior in scalac: scala/scala#6661

@smarter smarter closed this as completed in 10ad94b Nov 9, 2018
smarter added a commit that referenced this issue Nov 9, 2018
Fix #5414: Always emit / for path in decompilation comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants