github scala/scala3 3.3.8-RC1

pre-release4 hours ago

Highlights of the release

  • Support for JDK 26 #24430
  • Multiple coverage improvement to make it on par with Scala 2 support including
    // $COVERAGE-OFF$ and // $COVERAGE-ON$ markers
  • New @uncheckedOverride annotation for definitions that may override
    #24545
  • Trap Ctrl-C in the REPL: if no command is running clear the prompt, if some
    command is running ask for confirmation before exiting
    #24127
  • Numerous linting and presentation compiler improvements and fixes

Other changes and fixes

Access modifiers

  • Check protected parent constructor accesses only occurs in child constructors
    #25511
  • Fix protected constructor access
    #25523

Annotations

  • Improve ref check of constructors
    #24342
  • Also copy param annots at mixin
    #24916
  • Named arg may be deprecatedName
    #21588
  • Fix: emit deprecation warnings when a symbol is annotated by a deprecated
    annotation #23906
  • Fix #20063: Java leading annotation parsing
    #25503
  • Accommodate adapted Scala 2 annotation value
    #17516
  • Regression test for #3403 #25521
  • Fix: do not allow @targetName on primary constructor too
    #24682
  • Add @uncheckedOverride annotation for definitions that may override
    #24545

Backend

  • Chore: add regression test for #4528
    #24663
  • Cast inline call results to result type, not method type
    #25111
  • Regression tests for #25 #25536
  • Enforce JVM UTF-8 string limits in the backend
    #25300
  • Do not simplify isInstanceOf if unrelated types might be subtypes at run-time
    #25535
  • Adjust purity of trait with lazy member
    #23788
  • Use Objects.equals in translating ==
    #25314
  • Fix generic signatures for mixin forwarders conflicting type parameter names
    #24567
  • No mixin forwarder when ancestor is sealed
    #23482
  • Simplify JVM interface list emission, remove a mini-phase
    #25203
  • Chore: optimize lazy val with power of two
    #22428

Classpath

  • Skip module-info.class files during REPL tab-completion
    #24838
  • Fix for #22461 Empty ClassPath attribute in one or more classpath jars causes
    crash #22462

Coverage

  • Make coverage more similar to the one in Scala 2
    #23722
  • Fix #25555: Preserve singleton precision during scoverage lifting
    #25556
  • Fixes #25482: Ensure package transformation properly handles language imports
    in InstrumentCoverage #25546
  • Bugfix: Fix issues with Scala JS and coverage
    #24769
  • Make coverage support incremental compilation
    #24773
  • Add support for local coverage on and off with // $COVERAGE-OFF$ and
    // $COVERAGE-ON$ #24486
  • Improvement: Try to optimize coverage phase
    #24925
  • Scoverage: do not instrument erased values
    #25298

Default parameters

  • Fix named arguments evaluation order with by-name parameters
    #25161

Documentation

  • Docs: Enforce links checks in the generated docs
    #25425
  • Improve the contributing guide
    #25384
  • Extend copyright into 2026
    #24927
  • Update README: This is Scala 3
    #25424
  • Explain implicit vs default args
    #25311
  • Fix some scaladoc in compiler
    #24166
  • Docs: fix task name for scaladoc/testOnly
    #23678
  • Replace internal tab char in comment in Synthesizer.scala
    #23691

Enums

  • Fix Java enum forwarders to pull from companion on initialization
    #24361
  • Make enum apply ascriptions inferred types
    #25562

Exports

  • Fix: look at the underlying of a TermRef for a getter
    #24565

Extension Methods

  • Accept using right associative parameters
    #24766
  • Add ctor proxies before exports
    #24884
  • Fix pkg obj prefix of opaque tp ext meth
    #21527
  • Better handling of illegal trees in extension
    #25368
  • Fix LiftToAnchors for higher-kinded type applications
    #23672
  • Prevent crash when extension not found
    #18830

GADTs

  • Also trust TypeTest when there is a Bind
    #24568

Implicits

  • Only check seen for LazyRef for TypeSizeAccumulator
    #20459
  • Chore: add regression test for #8581
    #24666
  • Fix "Regression in zio/zio-schema for typer/implicit resolution"
    #24156
  • Fix implicit scope liftToAnchors for parameter lower bounds
    #23679

Inference

  • Tweak type for tryParameterless
    #24716

Initialization

  • Refine parameter adaptation logic for arrays
    #23591

Infrastructure

  • Tweak tests to not fail under jdk 25
    #25148
  • Bump actions/upload-artifact from 6 to 7
    #25423
  • Bump actions/download-artifact from 7 to 8
    #25420
  • Bump VirtusLab/scala-cli-setup from 1.12.2 to 1.12.3
    #25422
  • Bump coursier/cache-action from 7 to 8
    #25220
  • Bump actions/upload-artifact from 5 to 6
    #24758
  • Bump actions/download-artifact from 6 to 7
    #24759
  • Bump actions/checkout from 5 to 6
    #24517
  • Bump actions/upload-artifact from 4 to 5
    #24268
  • Bump actions/download-artifact from 5 to 6
    #24271
  • Bump actions/download-artifact from 4 to 5
    #23711
  • Bump actions/checkout from 4 to 5
    #23710
  • Chore: bump sbt to 1.11.5 #23805
  • Chore(deps): bump actions/setup-java from 4 to 5
    #23812
  • Chore: Use numberOfWorkers instead
    #24338
  • Improvement: Additional way of defining ENABLE_BSP_ALL_PROJECTS
    #24122
  • Formatting: Format presentation-compiler with scalafmt
    #24977

Inline

  • Chore: add regression test for #22575
    #25337
  • Ensure the inline match scrutinee type conforms to the recalculated type
    #24988
  • Make containsOuterRefsAnywhere follow aliases
    #25214
  • Find annotation args in inline expansion
    #24895
  • Chore: add regression test for #10343
    #24668
  • Improve the test for creating protected method accessors for inlines
    #25865
  • Do not update Symbol defTrees when retyping after Inlining
    #23870
  • Prevent opaque types leaking from transparent inline methods
    #23792
  • Chore: add regression test for #8194
    #24655
  • Also substitute symbols in case bindings symbols
    #24849
  • Inlines: decide sealing against original target, while using widened type as
    cast destination #25448
  • Fix inline match on blocks with multiple statements
    #20125

JDK

  • Skip over JEP 445 compact compilation units
    #23247
  • Handle MissingType during Erasure phase
    #24817
  • Don't generate bridge methods for inaccessible Java package-private methods
    #25166
  • Fix isJvmAccessible to handle nested protected Java classes
    #24625
  • Upgrade ASM to 9.9 for JDK 26 support
    #24430
  • Fix java record varargs field accessor
    #24172

Linting

  • Fix false unused import warning for given CanEqual in pattern matching
    #25231
  • Move second CheckUnused after pattern matcher
    #25114
  • Extension check handles hiBound of opaque type
    #25172
  • Unused lint ignores args to ctor of enclosing class
    #24768
  • Parameter name can be masked in import
    #24635
  • CheckUnused examines type of Apply
    #24465
  • Check for synthetic case methods in unused lint
    #24239
  • Lint avoids revisiting Inlined.call
    #24277
  • Register no elements for lint after inlining
    #24279
  • Ignore warnings when compiletime.testing is imported
    #24036
  • Unused lint does not rewrite suppressed warnings
    #24055
  • Drill through type lambda for tree symbol
    #23699
  • Invent given pattern name in for comprehension
    #23121
  • Check inline expansion for exclusion
    #23019
  • Unused var message mentions unread or unset
    #23719
  • Warn unused masking imports, remove obsolete unused options
    #23757
  • Distrust tree pos for patvar lint
    #25043
  • Match apply in PolyFunction for override
    #25505
  • Value discard checks inline call for exemption
    #25554
  • Lint enum case in outer context
    #24652
  • Preserve select of exported member in newExpr
    #24570
  • Always traverse Inlined.call in linter
    #24043
  • Lint function arrow intended context function
    #23847
  • Use enclosing enclosingInlineds for empty call
    #24281
  • Exclude synthetic opaque proxy from lint
    #24264
  • Regression test locals #25433
  • Augment regression test #24327

Match Types

  • Fix regression: Prioritize tree type over proto type when typing Binds
    #24175

Metaprogramming

  • Warn about encoded pkg obj names
    #22707
  • Bugfix: Fix possible SuspendException thrown when using macros
    #24174

Nullability

  • Patch to allow interop with XMLBuilder and -Yexplicit-nulls
    #25221
  • Add jspecify NonNull annotation to NotNullAnnots list
    #24487
  • Add quick fix to add .nn #23598

Opaque Types

  • Preserve insertion order when balancing And/OrType
    #25361
  • Treat synthetic casts as pure
    #25126
  • Make opaque types decomposable
    #24068

Overloading

  • Pretype args before skipping clause of overloaded application
    #23012
  • Fix varargs overload resolution with wildcard types
    #24669
  • Fix wildcardArgOK for mixed wildcard/concrete type args
    #25001
  • Regression test #16004 #24086
  • Tweak tryParameterless to use readapt
    #24078
  • Fix override checking for Java methods with covariant array
    #24408
  • Prefer non-extension to extension
    #24943
  • Fix class super-call invokespecial owner
    #25437

Parser

  • Accept primitive.class in annotations
    #25363
  • End of new expr never shrinks
    #25253
  • Permit new with trivial end
    #24331
  • Improve message for nested package missing braces
    #23816
  • Check seen for TypeParamRef in TypeSizeAccumulator
    #25264
  • Observe outdent also for type cases and type blocks in quotes
    #25519
  • Fix: import resolution for Java
    #25537
  • Error tree on outdent is zero extent
    #23796
  • Don't automatically insert OUTDENT before COMMA
    #25501
  • Fix: allow postfix setters under language.postfixOps
    #23775
  • Additional regression tests
    #25506

Pattern Matching

  • Emit unchecked warnings for trait patterns
    #24962
  • Fix false exhaustivity warning for seq match
    #23968
  • Call inhabited for AppliedType recursively
    #23964
  • Fix Ycheck crash from singleton tuple selects after specialization
    #25331
  • Fix false unreachable case warning
    #23800
  • Use upper bound of abstract types in exhaustivity checking
    #23909
  • Extend caching in the space engine beyond local context
    #23483
  • Prevent from getting children in case of non-sealed private
    #25359
  • Use MatchCaseUnreachable #24829
  • Preserve singleton types for final val aliases to Java enum constants
    #24980
  • Try expanding case class to the product of its fields
    #25454
  • Never widen constant type on selector type in matches
    #25197

Pickling

  • Fix #24456: Cleanup the info of a Bind symbol in posttyper
    #24490
  • Fix #24207: Cleanup the type of UnApply trees in posttyper
    #24259
  • Chore: add a regression test for #15786
    #24658
  • Don't absolutize sources outside of the sourceroot in TASTy
    #25429

Positions

  • Preserve span of this during statification of trait constructors
    #25354
  • Compute the right span for abstract error messages
    #23853
  • Use a better span for an anonymous class
    #24640

Presentation Compiler

  • Improvement: Use method type if it's available
    #25641
  • Bugfix: Don't add square braces in context bounds
    #25798
  • Bugfix: Fix issue with empty name throwing exceptions
    #25752
  • Bugfix: Fix wrong type in InferredType code action
    #25469
  • Bugfix: Fix issues in presentation compiler when using Scala JS
    #25450
  • Improvement: Add fallbacks in non critical places for presentation compiler
    #25483
  • Fix & feat: improvements in selection ranges
    #25290
  • Feat(pc): add closing labels inlay hints
    #25178
  • Bugfix: remove stale top-level symbols between runs
    #25317
  • Bugfix: Fix various minor presentation compiler issues
    #25256
  • Fix: ignore implicit apply for signature help
    #25294
  • Fix incorrect XRay hint #24738
  • Presentation compiler: propagate isDebug timeout check to all tests
    #25068
  • Handle inlined tree in implicit parameter inlay hints
    #24762
  • Create extension method in infer method action
    #24721
  • Fix opaque types displayed as Nothing & Any in hover and signature help
    #24921
  • Fix negative activeParameter in signature help
    #24945
  • Closes #7532: Parameter hints not working for functions
    #23854
  • Improvement: Allow passing -explain to the presentation compiler
    #24740
  • Exclude XRayModeHint for synthetics
    #24722
  • Add unsafe RawPresentationCompiler implementation
    #24133
  • Bugfix: Make sure that we can query tree.source
    #24123
  • Improvement: additional completions for using clause
    #23647
  • Inlining interpolated variables
    #25144
  • Bugfix: inline value false-positive shadowing with lambda params
    #25140
  • Fix issue with pc breaking in requiredMethod on newly overloaded valueOf
    #23708
  • Pc: completions - do not add [] for ... derives TC@@
    #23811
  • Porting XRayModeHints #23891
  • Improve symbol order in completions provided by the presentation compiler
    #23888
  • Bugfix: Fix issues with Scala JS and the presentation compiler
    #25550
  • Bugfix: Show hover on derives clause
    #25804
  • Improvement: improve perfomance of the presentation compiler
    #25769
  • Coursier dependency imports should have lexicographic ordering
    #21592

Quotes

  • Fix crashing for context bound type variables in quoted patterns
    #25286
  • Fix #25208: handle AndType(TermRef, TypeRef) in TreeUnpickler path trees
    #25209
  • Remove redundant mapOver in fixThisTypeModuleClassReferences
    #25440
  • Make typeArgs in QuotesImpl work for AnnotatedTypes
    #24018
  • Improve LambdaTypes handling in Quotes reflect memberType
    #25786

Reflection

  • Fix Select.copy in reflect API losing DerivedName for default getters
    #25269
  • Do not expose ClassInfo in memberType in reflect API
    #24922
  • Quotes reflect: Allow to return DefDef from a val symbol tree
    #22603

Reporting

  • Force conditional warnings when configured
    #25552
  • Use deprecatedOverriding message
    #25439
  • Fix #24711: Use dot notation for Java nested types in error messages
    #24919
  • Enhance WInferUnion to not warn propagated explicit union types
    #25280
  • Fixes #24233: Remove misleading JDK compatibility hint for TASTy errors
    #25171
  • More descriptive "not found" message when type/term exists with the expected
    term/type name #24959
  • Mention named givens in double def explainer
    #23833
  • Do not discard amended format when f-interpolator warns
    #23697
  • Use dollar-free param names in stub implementations
    #25646
  • Error mentions bad _1 selector
    #25616
  • Add ErrorMessageID to -Winfer-union warnings (#25073)
    #25249
  • Addendum when apply error involves default arg
    #21133
  • Warn on Scala 2 auto-apply if loosely nullary
    #24811
  • Forward reference error includes line numbers
    #22534
  • Use other tree for actual symbol of Assign
    #22869
  • Add "did you mean to use parentheses/a block" when finding a complex
    expression on the RHS of an infix operator
    #25099
  • Fix printing references to nested objects
    #25086
  • Add error note for type mismatch involving blocks without last expression
    #25181
  • Don't suggest invisible members of root imports
    #24999
  • Improve multi-line code message rendering
    #24723
  • Warn if type argument was inferred as union type
    #24258
  • Improve printing of strings
    #22945
  • Better error message: reassignment to val
    #24184
  • Add addendum to private val parameter variance error message
    #23876
  • Regression tests #24876

REPL

  • Make REPL type echo-ing use partially qualified names where made possible by
    imports #24850
  • Remove pipes from multi-line REPL prompts
    #24307
  • Fix "Colon as operator part at beginning of line in REPL"
    #24942
  • Trap Ctrl-C in the REPL: if no command is running clear the prompt, if some
    command is running ask for confirmation before exiting
    #24127

Rewrites

  • Deduplicate patches before applying them to sources
    #24215

Runner

  • Fix for #22443: prevent stty from being called when not running in a terminal
    #22444

Scaladoc

  • Do not hide when a class or a trait extends Any
    #25403
  • Ability to hide snippets from the documentation
    #25411
  • Use <sup> tags for exponents in Scaladoc comments
    #25645
  • Fix duplicate member entries in Scaladoc generation
    #24712
  • Scaladoc Overload Method Link Fix
    #25156
  • Init MacroClassLoader in scaladoc
    #25141
  • Scaladoc: Take title from sidebar.yml into account
    #18997
  • [scaladoc] Allow to additional scalacOptions in Markdown code snippets
    #24755
  • Fetch the right kind for synthesised definitions
    #25405
  • Add the transparent flag to java.lang.Object
    #25394

SemanticDB

  • Add context parameters to SemanticDB synthetics
    #23381
  • Better refinement symbols in semanticDB
    #18604
  • Encapsulate SemanticDB package, unify symbol and document printing
    #25084

Testing

  • Fix line and path separators in test
    #23534
  • Fix: update checkfile for i23905
    #24064

Testing framework

  • Reject check file match with stack trace
    #22389
  • Cleanup compiler test. remove unnecessary isJavaAtLeast conditions
    #24589
  • Bugfix: Don't run coverage tests in testCompilation without --coverage flag
    #24932
  • Cleaner, quieter test rig tests
    #24073
  • Skip tests with no sources such as .scala-build dir
    #25173
  • Report info logs in checked test output if enabled with -Ylog
    #25391
  • Bugfix: Fix flaky test in ScalaJSCompletionsSuite
    #25539
  • Add regression test for #23195
    #24853
  • Test hover on backticked identifiers with whitespace
    #25142

Transform

  • Check extension method at typer
    #24199
  • Always encode in derived name
    #23478
  • Fix "Scala 3.8.3 compiling covariant overrides with separate compilation
    causes AbstractMethodError at runtime"
    #25659
  • Make Phase.run protected #25366

Tuples

  • Fix inconsistent typeSize calculation for TupleN vs recursive pair
    encodings #24743
  • Fix: make vals created in desugaring of n-ary lambdas non-synthetic
    #23896
  • Normalize tuple types when typing patterns
    #25335
  • Fix #24997: Avoid unnecessary CHECKCAST in untupled function parameters
    #25085

Typeclass Derivation

  • Fix #23043: spurious package conflict from non-class directories
    #25441
  • Also checkRefinement for Singleton mirror
    #24080

Typer

  • Use TypeComparer.constValue in TypeEval
    #24718
  • Fix crash in Selectable unapply with custom applyDynamic
    #24343
  • Prevent crash in SAM conversion with mismatched arity
    #23877
  • Detect InsertedApply on Apply to break synthetic apply loops, not just
    Select #25463
  • Typer: remove by-name lifting and replace default-getter args with fresh syms
    #25502
  • Refine isEffectivelyFinal to avoid no-owner crash
    #23675
  • Do not generate access proxies for locally defined protected defs
    #25056
  • Use dealiasKeepRefiningAnnots in AvoidMap
    #25609
  • Fix #24573: Add stricter checks for platform SAM compatibility
    #24624
  • Make isExactlyNothing and isExactlyAny work for And/OrTypes
    #24016
  • Handle assertion error in TyperState
    #23665
  • Fix: correctly require a ClassTag when building a multidimensional Array
    #23902
  • Fix crash when processing path dependent context functions using HKTs
    #25530
  • Regression test #24820
  • Chore: add regression test for #13889
    #24657

XML

  • Use toVector for XML literal sequences
    #23221

Union types

  • Dealias in isSimpleThrowable check
    #24744

Don't miss a new scala3 release

NewReleases is sending notifications on new releases.