Skip to content

Commit ddc5ac0

Browse files
committed
Address review suggestions
1 parent bc9d3ac commit ddc5ac0

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

_posts/2025-05-07-release-notes-3.7.0.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ Named tuples are a convenient lightweight way to return multiple results from a
6565
List(
6666
(x = 1, y = 0),
6767
(x = 2, y = 3),
68-
( 3, 0,),
68+
( 3, 0),
6969
).partitionBy:
7070
case (x = x, y = 0) => x < 5
7171
.matching.map(_.x)
7272
.foreach(println)
7373

7474
val measurements = List[(location: String, value: Double)](
75-
("Lousanne", 8.05),
75+
("Lausanne", 8.05),
7676
("London", 21),
7777
("Rome", 37.0),
7878
)
@@ -169,7 +169,7 @@ case class Product(
169169
@unroll description: Option[String] = None,
170170
){
171171
// generated by compiler:
172-
// def this(name: String, price: BigDecimal) = this(name, price)
172+
// def this(name: String, price: BigDecimal) = this(name, price, default$1)
173173
// def copy(name: String, price: BigDecimal) = this(name, price)
174174
}
175175

@@ -181,8 +181,8 @@ object Factory:
181181
): Unit = ???
182182

183183
// generated by the compiler:
184-
// def processOrder(products: List[Product]): Unit = processOrder(products)
185-
// def processOrder(products: List[Product], quantity: Int): Unit = processOrder(products, quantity)
184+
// def processOrder(products: List[Product]): Unit = processOrder(products, default$1, default$2)
185+
// def processOrder(products: List[Product], quantity: Int): Unit = processOrder(products, quantity, default$2)
186186
```
187187

188188
More details can be found in [`@unroll` reference](https://docs.scala-lang.org/scala3/reference/experimental/unrolled-defs.html)
@@ -233,6 +233,13 @@ Starting with Scala 3.7 the expression compiler has been migrated to the main [s
233233
The presentation compiler is a specialized instance of the Scala compiler that runs interactively in IDEs or LSPs, providing immediate feedback about code correctness, type checking, symbol resolution, autocompletion, error highlighting, and other editing support functionalities.
234234
Some of the latest improvements to the presentation compiler focus on the ability to infer more information about expected types of expressions provided by the users. As the results presented compiler can now show the users the expected type of expression when hovering over holes.
235235

236+
```scala
237+
def someMethod(count: Int, label: String): Unit = ???
238+
someMethod(???, ???)
239+
```
240+
241+
Given the code snippet above hovering on the first placeholder would now provide information for Metals that `Int` is required, similarlly hovering on second `???` placehold would result in hint about missing argument of `String` type.
242+
236243
### Quotes API changes
237244

238245
Scala 3.7 introduces changes to the experimental subset of Quotes API. One notable addition is the `apply` methods to import selectors ([#22457](https://github.com/scala/scala3/pull/22457)), simplifying the construction of import statements within macros. This feature streamlines the generation of import trees, making macro code more concise and readable.​
@@ -319,7 +326,7 @@ Scala 3.7 brings a crucial fix that enhances its compatibility with the Android
319326

320327
The update addresses this by modifying the Scala compiler to box the return type of native instantiated methods when the SAM's return type isn't primitive. This change ensures that lambda expressions conform to ART's expectations, preventing runtime errors on Android devices. By aligning the compiler's behaviour with ART's requirements, the Scala 3 development for the Android platform should be unblocked, although it might require recompiling existing libraries using Scala 3.7 or the upcoming Scala 3.3 LTS version containing a backported fix.
321328

322-
### Minimal support for dependant case classes [#21698](https://github.com/scala/scala3/pull/21698)
329+
### Minimal support for dependent case classes [#21698](https://github.com/scala/scala3/pull/21698)
323330

324331
Starting with Scala 3.7, developers can now define case classes with dependent fields, marking a notable improvement in expressiveness and type safety. This allows fields within a case class to depend on other constructor parameters via path-dependent types. One use case is encoding a configuration system where each setting has a distinct value type determined by the setting itself.
325332

@@ -339,7 +346,7 @@ class IntSetting(name: String) extends Setting(name):
339346
override type Value = Int
340347

341348

342-
@main def DependantCaseClasses =
349+
@main def DependentCaseClasses =
343350
given Context = new {}
344351
val settings = List[ConfigEntry](
345352
ConfigEntry(StringSetting("docs.page"), "https://docs.scala-lang.org/"),
@@ -394,7 +401,6 @@ Looking ahead, you can expect two more patch releases before Scala 3.8, which is
394401

395402
The Scala compiler team aims to finalize all major changes in 3.8, followed by a soft feature freeze and a stabilization period. This ensures a smooth transition for users and maximizes the stability of the compiler and tooling ecosystem ahead of the LTS release.
396403

397-
398404
# Contributors
399405

400406
Thank you to all the contributors who made this release possible 🎉

0 commit comments

Comments
 (0)