Scala 3.8.3 ships several notable features: local coverage exclusion blocks via $COVERAGE-OFF/$COVERAGE-ON markers, an experimental capability-safe language subset called safe mode designed for agent-generated or untrusted code (paired with @assumeSafe escape boundaries), and a port of the Scala 2 JVM backend optimizer offering opt-in bytecode inlining and optimization flags. The -print-lines flag is deprecated to a no-op and will be removed in Scala 3.9.0. Full changes are listed in the GitHub release notes.
Table of contents
Local coverage exclusions with // $COVERAGE-OFF$ blocks ( #24486 )Safe mode for capability-safe code ( #25307 )Scala 2 JVM optimizer ported to Scala 3 ( #25165 )-print-lines is deprecated for removal, but remains accepted as a no-op ( #25330 )Questions this post answers
How do I exclude specific lines of code from coverage reports in Scala 3.8.3?
Wrap the code in // $COVERAGE-OFF$ and // $COVERAGE-ON$ comment markers within a coverage-instrumented build. Only the code between the markers is skipped by coverage instrumentation while the rest of the file is measured normally, useful for generated code or intentionally defensive branches without excluding an entire file or class. Track new Scala compiler capabilities like this on daily.dev as tooling evolves.
What is safe mode in Scala 3.8.3 and what does it restrict?
Safe mode is an experimental capability-safe language subset enabled with import language.experimental.safe or -language:experimental.safe, intended for agent-generated or untrusted code. It rejects unchecked casts and pattern matches, forbids caps.unsafe, @unchecked, and runtime reflection, enables capture checking with mutation tracking, and restricts global API access unless marked @assumeSafe. Developers evaluating safety models for AI-generated code can follow Scala's approach on daily.dev.
How do I enable the JVM bytecode optimizer in Scala 3.8.3?
Use the -opt compiler flag to enable local bytecode optimizations, and -opt-inline:<patterns> to control which classes or packages can be inlined across call sites, such as -opt-inline:<sources>,my.app.**,!java.**. This ports the Scala 2 JVM backend optimizer to Scala 3, giving feature parity and opening potential performance gains for JVM applications. Anyone tuning JVM performance in Scala can keep up with optimizer changes via daily.dev.