-
Notifications
You must be signed in to change notification settings - Fork 325
Add Scala 3.6.2 announcement #1699
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
|
||
Besides multiple bugfixes, this release stabilises multiple experimental features introduced to Scala language after careful review and acceptance by the [Scala Improvement Proposal's Commitee](https://docs.scala-lang.org/sips/). Many of these changes can have a significant impact on the Scala syntax and are introducing new amazing possibilities in writing concise, typesafe as well as easier, and easier to maintain code. | ||
|
||
## SIP-47 - Clause Interleaving |
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.
@sjrd Can I ask you for a technical review or some improvements, as you're one of the SIP authors
} | ||
``` | ||
|
||
## SIP-58 - Named Tuples |
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.
@odersky Can I ask you for a technical review or some improvements, as you're the author of these changes?
|
||
It also introduces changes to how your code is desugared by the compiler to `map` method calls, leading to a more optimized code by removing redundant calls where possible. | ||
|
||
## SIP-64 - Improve Syntax for Context Bounds and Givens |
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.
@odersky Can I ask you for a technical review or some improvements, as you're the main author of these changes?
…s, make named tuples example less controversial
…courage to test it out in notable changes section
``` | ||
|
||
Reordering the fields is binary-compatible but it might affect the meaning of `@Annotation(1)` | ||
Starting from Scala 3.6, named arguments are required for Java-defined annotations that define multiple parameters. Java defined annotations with a single parameter named `value` can still be used anonymously. |
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.
This wording seems to suggest that annotations are supposed to be used anonymously rather than their arguments, which is slightly confusing. Also I think unnamed
would be clearer than anonymous
in this context.
And actually unnamed arguments might also work for annotations with multiple parameters given that only one argument is passed to the annotation's 'pseudo-constructor' (the one corresponding to value
parameter) and the other parameters have a default value. e.g.
import java.lang.annotation.*;
public @interface MyAnnot {
String value();
String value2() default "default";
}
@MyAnnot("abc")
class Foo
Just please pick some better names if you're going to reuse this example 😉
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.
Don't you this example might be confusing to reader? In this case depening on number of used parameters in the example you might skip names if only 1 param is used, or all required to name all of them to otherwise.
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.
Actually it might be usefull to explain the rules better, I've updated the example
No description provided.