Skip to content

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

Merged
merged 7 commits into from
May 29, 2017
Merged

Conversation

odersky
Copy link
Contributor

@odersky odersky commented May 29, 2017

No description provided.

---

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.
Copy link
Member

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
Copy link
Member

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.

Copy link
Member

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
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: dupport -> support

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed, thanks!

@odersky odersky merged commit a45451a into scala:master May 29, 2017

2. Implicit parameters may not have singleton types.

/*!*/ def f(implicit x: y.type) // error `y.type` not allowed as type of implicit
Copy link

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.
Copy link

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

Copy link

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?

Copy link
Contributor

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)

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.

5 participants