Highlights of the release
- Add
@scala.annotation.internal.preview
annotation and-preview
flag. #22317 - Make SIP-52
@publicInBinary
a stable feature in 3.7 #22591 - Make SIP-58 -
Named Tuples
a stable feature in 3.7 #22753 - Make SIP-62 -
Better Fors
a preview feature in 3.7 #22776 - Implement SIP-61
@unroll
annotation as experimental #21693 - Implement SIP-68
Reference-able Package Objects
as experimental #22011 - Upgrade Scala 2 Standard Library to 2.13.16 #22386
- Upgrade Scala.js to 1.18.1. #22397
- Upgrade Scala CLI to 1.7.0 #22735
- Expression Compiler is now part of Scala 3 compiler #22597
- Quotes API: Added
apply
methods to import selectors #22457 - Quotes API: Implement experimental
summonIgnoring
method #22417 - Quotes API: Add class parameters, flags, and privateWithin and annotations to experimental
newClass
methods #21880 - Experimental: Capture Calculus - Inferring
tracked
modifier #21628 - Presentation Compiler: Show inferred type on holes in hover #21423
- JVM Backend: Fix #15736 blocking Scala 3 on Android #22632
- REPL: add flag to quit after evaluating init script #22636
- REPL: implement :jar (deprecate :require) #22343
- Linting: Improvements to -Wunused and -Wconf #20894
- Implicit parameters warn at call site without
using
keyword #22441 - Minimal support for dependent case classes #21698
Other changes and fixes
Annotations
- Lift arguments of explicitly constructed annotations #22553
- Fix copy of annotation on
@main
methods #22582 @publicInBinary
has now effect on secondary constructors #22630- Fix mapping of annotations #22407
Backend: Scala.js
- Emit
js.NewArray
IR nodes when possible. #22446
Classpath
- Fix empty ClassPath attribute in one or more classpath jars causes crash #22462
Documentation
- Improve the usage of inclusive language #22360
Erasure
- Handle type aliases in contextFunctionResultTypeAfter #21517
- Align erasure of
Array[Nothing]
andArray[Null]
with Scala 2 #22517
Desugering
- Under
betterFors
don't drop the trailingmap
if it would result in a different type (also drop_ => ()
) #22619
Experimental: Capture Checking
- Canonicalize capture variable subtype comparisons #22299
- Permit Capture Refs for Uninitialized Type and Term Params in BiTypeMap #22451
- Fix maximal capability handling and expand aliases #22341
Experimental: Modularity
- Widen skolem types when adding parent refinements #22488
Experimental: Global Initialization Checker
- Refactor the abstract domain of global init checker to compile http4s #22179
- Fix global init checking crash when using a value defined in by-name closure #22625
Experimentals
- Expand value references to packages to their underlying package objects #22011
Implicits
- Restrict implicit args to using #22458
Linting
- Suppress spurious Suppression #22383
- CheckUnused checks span.exists before testing its parts #22504
- Don't warn retainedBody #22510
- Handle Typeable #22663
- Nowarn public implicit val class params #22664
- Exclude synthetic this.m, Any.m from import lookup #22695
- Warn unused member of anonymous class #22729
- Ignore params to default arg getters #22749
- Lazy val def member is pattern var #22750
- Restore resolving prefixes of implicit Ident #22751
- No warning for parameter of overriding method #22757
- Dealias before checking for member in lint #22708
- Warn on bad extensions of aliases #22362
- Warn universal extensions on opaque types #22502
- Discourage default arg for extension receiver #22492
- Rename on import is never wildcard #22712
- Collect nowarn symbols instead of skipping them #22766
Match Types
- Handle NoType in TypeComparer.disjointnessBoundary #21520
Named Tuples
- Special case NamedTuple.From for arguments derived from Tuple #22449
- Generate mirrors for named tuples #22469
Opaque Types
- Fix stack overflow errors when generating opaque type proxies #22479
- Fix inline proxy generation for opaque types referencing other opaque types #22381
- Fix opaque types leaking rhs when inlined and found in type params (and a related stale symbol issue) #22655
Overloading
- Make overload pruning based on result types less aggressive #21744
Parser
- Fix annotations being not expected in the middle of an array type by java parser #22391
- No outdent at eof #22435
- Allow observing an indent after conditional #22611
- Correctly detect colon lambda eol indent for optional brace of argument #22477
Pattern Matching
- Avoid crash in uninhab check in Space #22601
- Account for named tuples in space subtraction #22658
- Check exhaustivity of any case class #22604
Presentation Compiler
- Add enum type param support in sourceSymbol #18603
- Map name position to desugared version of named context bound #22374
- Hover and go to definition for named tuples #22202
- Completions: do not complete package #20532
- Print parens for single method argument only if a direct tuple type #21510
- Improvement: use heuristic to figure out
nameSpan
ifpointDelta
too big #22484 - Fix inferredTypeEdits for symbols #22485
- Fix: Only fallback to the definition of a synthetic valdef if it is zero extent #22551
- Better LSP completions inside of backticks #22555
- Don't search for members in pc info when irrelevant #22674
- Backport from Metals #22426
- Backport from Metals #22491
- Backport from Metals #22665
Runner
- Upgrade Scala CLI to 1.7.0 highlights
- Switch to scalameta/scalafmt images of scalafmt 3.9.1+ #3502
- Support the
--test
command line option forrun
subcommand #3519 - Support the
--test
command line option forpackage
subcommand #3519 - Detect objects with main class in scripts #3479
- Support for Scala.js 1.18.2 #3454
- Support for Scala Native 0.5.7 #3527
- Add support for running a main method from the test scope #3502
Quotes
- Add a check for correct Array shape in quotes.reflect.ClassOfConstant #22033
- Fix issue with static
this
references erroring in quoted code #22618 - Fix #21721: make case TypeBlock(,) not match non-type Block #21722
- Make Ref.apply() return trees usable in the largest scope possible #22240
- Make sure Block does not incorrectly match a TypeBlock #22716
- Do not approximate prefixes when using memberType in reflect API #22448
- Bring back pattern match exhaustivity checking for macros #22622
REPL
- REPL: JLine 3.29.0 (was 3.27.1) #22679
- Repl: emit warning for the
:sh
command #22694 - Add warning for :kind command #22572
Reporting
- Filter help renders box border #22434
- Register nowarn when inlining #22682
- Rule out exports of member of the current class #22545
Scaladoc
- Render
@deprecated
correctly even when named arguments weren't used #21925 - Remove DRI from Scaladoc warnings #22330
SemanticDB
- Don't add
()
to semanticdb symbol for java variables #22573 - Fix compiler crash when using betasty with missing java classfiles #22599
Transform
- Check only stable qual for import prefix #22633
- Treat static vals as enclosures in lambdalift #22452
- Record calls to constructors in lambdaLift #22487
- Only check logicalOwners for methods, and not for classes, when looking for proxies #22356
- Add error-checking when fetching rhs of trees from TASTy #22565
Typer
- Root of Java select must be class or rooted package #21800
- Check if a prefix is valid before selecting from a type #22368
- Preserve hard unions in widenSingletons #22369
- Constructor proxy is restricted if class is protected #22563
- Constructor companion gets privateWithin #22627
- Revert lambda cleanup #22697
- Avoid infinite recursion when looking for suggestions #22361
- Fix cyclic check, regardless of definition order #22342
- Avoid inf recursion in provablyDisjointClasses #22489
Value Classes
- Allow private members when computing the denotation of a NamedType #22549
Other changes
- Remove locale dependent FileSystemException check #21633
Known issues
Critical issues discovered after Scala 3.7.0-RC1 release - these would be fixed in subsequent RC release before 3.7.0:
- Running tests with
munit
and Scala.js breaks for Scala 3.7 #22794
Contributors
Thank you to all the contributors who made this release possible 🎉
According to git shortlog -sn --no-merges 3.6.4..3.7.0-RC1
these are:
59 Martin Odersky
43 Som Snytt
33 Adrien Piquerez
32 Hamza Remmal
21 Wojciech Mazur
19 aherlihy
19 kasiaMarek
15 Jan Chyb
13 Dale Wijnand
11 Kacper Korban
10 EnzeXing
7 Guillaume Martres
7 Matt Bovel
7 Oliver Bračevac
7 noti0na1
6 Sébastien Doeraene
5 HarrisL2
5 Jamie Thompson
5 dependabot[bot]
4 Joel Wilsson
4 Seth Tisue
3 Piotr Chabelski
3 Roman Janusz
3 anna herlihy
2 David Hua
1 Alec Theriault
1 Daisy Li
1 Daniel Thoma
1 Dmitrii Naumenko
1 Felix Herrmann
1 He-Pin(kerr)
1 João Ferreira
1 Jędrzej Rochala
1 Katarzyna Marek
1 Kenji Yoshida
1 Niklas Fiekas
1 Rocco Mathijn Andela
1 Vadim Chelyshov
1 Yichen Xu
1 adpi2
1 fan-tom
1 philwalk
1 rochala