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

Note changes in unicode escapes and case companion #2943

Closed

Conversation

som-snytt
Copy link
Contributor

@som-snytt som-snytt commented Jan 4, 2024

Scala 3 acquired extra help for case companions which was backported to Scala 2 (under -Xsource:3-cross). 🤞

I did not build locally to review output, so this is best-effort for formatting.

@som-snytt
Copy link
Contributor Author

It looks like CI fails for SIP links to virtus labs. Difficult to keep internal docs in sync with external sites that may evolve dynamically.

@@ -139,6 +139,14 @@ REPL, but won't work in typical Scala 3 application code.
For an alternative way to detect the Scala 3 version, see
[this gist](https://gist.github.com/romanowski/de14691cab7340134e197419bc48919a).

### I want to use Scala 3 but now a bunch of stuff just broke in my project. What's up with that?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think this should be in the FAQ.

{% endtab %}
{% endtabs %}

In Scala 2.13.13, this behavior is enabled under `-Xsource:3cross`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In Scala 2.13.13, this behavior is enabled under `-Xsource:3cross`.
In Scala 2.13.13, this behavior is enabled under `-Xsource:3-cross`.


## Unicode escapes

Unicode escapes of the form `\u0061` are no longer natively supported in any position by the compiler.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"natively supported" seems unclear to me. not sure what best replacement is, maybe:

Suggested change
Unicode escapes of the form `\u0061` are no longer natively supported in any position by the compiler.
Unicode escapes of the form `\u0061` are no longer allowed in arbitrary locations in source code.


Unicode escapes of the form `\u0061` are no longer natively supported in any position by the compiler.

Instead, they processed like other escapes in string literals.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Instead, they processed like other escapes in string literals.
Instead, they are processed in string literals, just like other escape sequences.

Instead, they processed like other escapes in string literals.
This means, in particular, that they are not processed in "triple-quoted" strings or by the `raw` interpolator.

In Scala 2, a deprecation is issued, but under `-Xsource:3cross`, the behavior is the same as Scala 3.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In Scala 2, a deprecation is issued, but under `-Xsource:3cross`, the behavior is the same as Scala 3.
In Scala 2, a deprecation is issued, but under `-Xsource:3-cross`, the behavior is the same as Scala 3.

@som-snytt som-snytt closed this Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants