-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add docs on changed features #2592
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
Conversation
--- | ||
|
||
Lazy val initialization no longer guarantees safe publishing. This change was done | ||
to avid the performance overhead of thread synchonization because many lazy vals are only used in a single-threaded context. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: avid -> avoid
once it is assigned. | ||
|
||
The [ScalaFix](https://scalacenter.github.io/scalafix/) rewrite tool | ||
as well as Dotty's own `-migration` option will rewrite all normal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-migration is only for migration warnings, to get dotty to rewrite stuff you need -language:Scala2 -rewrite
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be best to not mention the dotty internal rewrite mechanism until we know what we want to do with it.
Previously, Scala supported structural types by means of | ||
reflection. This is problematic on other platforms, because Scala's | ||
reflection is JVM-based. Consequently, Scala.js and Scala.native don't | ||
dupport structural types fully. The reflction based implementation is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: dupport
-> support
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, thanks!
|
||
2. Implicit parameters may not have singleton types. | ||
|
||
/*!*/ def f(implicit x: y.type) // error `y.type` not allowed as type of implicit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is that by the way?
@volatile lazy val x = expr | ||
|
||
it is guaranteed that readers of a lazy val will see the value of `x` | ||
once it is assigned. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What exactly is the difference in behavior between volatile and non-volatile lazy vals?
|
||
/*!*/ case List(1, 2, xs @ _*) // syntax error | ||
/*!*/ case List(1, 2, _*) => ... // syntax error | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When developing Scalameta 2.x that's supposed to crosscompile against 2.x and 3.x, I found this to be an unfortunate problem. There's currently no way to write crosscompilable code that contains sequence wildcards. Can something be done with this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xeno-by AFAIK, we support both syntaxes under -language:Scala2
#1059
On 30 May 2017 01:14:25 Eugene Burmako [email protected] wrote:
xeno-by commented on this pull request.
+The syntax of vararg patterns has changed. In the new syntax one
+writes varargs in patterns exactly like one writes them in
+expressions, using a: _*
type annotation:
+
- xs match {
case List(1, 2, xs: _*) => println(xs) // binds xs
case List(1, _ : _*) => // wildcard pattern
- }
+The old syntax, which is shorter but less regular, is no longer
+supported:
+
- /!/ case List(1, 2, xs @ _*) // syntax error
- /!/ case List(1, 2, _*) => ... // syntax error
When developing Scalameta 2.x that's supposed to crosscompile against 2.x
and 3.x, I found this to be an unfortunate problem. There's currently no
way to write crosscompilable code that contains sequence wildcards. Can
something be done with this?--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#2592 (review)
No description provided.