Notable Changes
Platform
- The standard library was upgraded to Scala 2.13.4, JDK 14 and 15 are now supported. (#10392)
Syntax
- The
@infix
annotation was replaced by aninfix
modifier, the@mixin
annotation was replaced bytransparent
(#10458) - The
@alpha
annotation was renamed to@targetName
and can now be used to define overloads that would normally result in a double definition error (#10149) - Drop extension_ prefix for extension methods (#10128)
- The
Eql
typeclass has been renamedCanEqual
(#10449)
Reflection
Breaking changes
QuoteContext
has been renamedQuotes
(#10432)- Instead of importing
qctx.tasty._
, importquotes.reflect._
(#10442)- In general,
scala.quoted.qctx
was replaced withscala.quoted.quotes
- In general,
rootPosition
is nowPosition.ofMacroExpansion
(#10467)expr.unseal
is nowTerm.of(expr)
term.seal.cast[T]
is nowterm.asExprOf[T]
term.seal
is nowterm.asExpr
(tpe: Type[T]).unseal.tpe
was replaced withTypeRepr.of[T]
(tpe: Type[T]).unseal
was replaced withTypeTree.of[T]
(tpe: Type[T]).show
was replaced withType.show[T]
scala.quoted.Type
does not need to be named (implicitly only)(typeRepr: TypeRepr).seal
is now(typeRepr: TypeRepr).asType
- Owners are now explicit in the reflection API (#10406)
compiletime.code
has been replaced withcompiletime.codeOf
(#10313)- The syntax for type variables in quoted patterns has changed (#10125)
- Added
quotes.reflect.Flags.{Opaque, Open}
- Added constructors for
quotes.reflect.{TypeBoundsTree, WildcardTypeTree}
- Renamed
quotes.reflect.{GivenMatch => SummonFrom}
- Renamed
quotes.reflect.{Projection => TypeProjection}
- Changed constructor and extractor of
quotes.reflect.Lambda
- Removed
quotes.reflect.Context
and replaced with explicitSymbol
owners- In methods of
TreeMap
,TreeAccumulator
andTreeTraverser
- In
ValDef.let
formerlylet
- In
Lambda.apply
- In
etaExpand
- Added
Tree.changeOwner
andSymbol.spliceOwner
- In methods of
- Removed
scala.tasty.Reflection
(now it is insideQuotes
) - Reflection API uses
TypeTest
s instead ofClassTag
s
Additions
- new API:
TypeTest
for safe type tests at runtime (#7555)
Scala.js
- Upgrade to Scala.js 1.3.1 (#10423)
- Implement the
-scalajs-mapSourceURI
option (#10439) - Implement JS exports (#10164)
- Scala.js is now 100% supported
Scala3doc
- Numerous improvements over many PRs, Scala3doc is still not the default documentation tool (this requires setting
useScala3doc := true
), but it is now used to generate the https://dotty.epfl.ch/ website. - For more information on Scala3doc see https://contributors.scala-lang.org/t/scala3doc-doctool-for-scala-3/4477