Scala Plugin
Scala Plugin for IntelliJ IDEA and Android Studio
Scala 3.8 Support in the Scala Plugin
Hello everyone,
As I write these words, the Scala compiler team is wrapping up the Scala 3.8 release. It’s the last major release before a feature freeze. The next one, 3.9, will be the new Long-Term Support version. The compiler team decided that most of the work between 3.8 and 3.9 will go into stabilization, while new features and other improvements will be released with Scala 3.8. By providing support for the new Scala 3.8 features now, we’re able to give you the opportunity to enjoy and test them immediately. This will give both our team and the compiler team the opportunity to collect more and better feedback from you.
The into modifier
There’s a new modifier in Scala syntax, into, that can be used in two ways: as a wrapper over a type or as a soft keyword in front of classes, traits, opaque type aliases, and enum types. By wrapping a type with into[T] – for example, a type of a function parameter – we indicate that any type implicitly convertible to the declared type inside the into wrapper is accepted without requiring the implicitConversions import. The Scala plugin understands this mechanism, correctly infers types, and highlights cases where the conversion isn’t possible. In the future, using an implicit conversion without the implicitConversions import will be treated as an error.

Notice that into is used as a type wrapper for elems, but at the same time we can still use elems.iterator as if elems was of the underlying type IterableOnce[A].
Alternatively, if the type is in your codebase, you can also add the into modifier to indicate that implicit conversions into that type should always be allowed.
Please note that the warning displayed in the video appears only if Compiler-Based Highlighting is enabled.
You can read more about the into modifier in the Scala 3 documentation.
Scala 3.8 requires JDK 17+
In the new Scala release, the minimum required JDK version has been updated to 17. The latest version of the Scala plugin supports this requirement in two ways:
- In the New Project Wizard: If you select Scala 3.8+ or newer, but choose a JDK version older than 17, a warning popup that reads “JDK >= 17 is required with Scala 3.8” will appear.

- In existing projects: If your Scala project or any of its modules requires Scala 3.8+ but is being compiled on a JDK version lower than 17, IntelliJ IDEA will display a special warning.

“Better fors”
“Better fors” might sound a bit awkward for a feature name, but it introduces a significant and long-anticipated syntax relaxation for Scala’s for-comprehensions. Previously, a for-comprehension had to start with a generator, such as number <- List(1, 2, 3). If you wanted to use an alias, like list = List(1, 2, 3), you had to place it after a generator or define it before the entire for-comprehension and save the result as a value. Now, Scala 3.8 and the Scala plugin support having just the alias before a generator and transforming it into a value automatically.

Basic support for capture checking
The Scala standard library is now compiled and published using Scala 3. You can see it in the Project view of a Scala 3.8 project. Simply scroll down and unfold the following path: External Libraries | sbt:org.scala-lang.scala-library-3.8.0:jar | scala-lang.scala-library-3.8.0:jar. There, you can find and open standard library source files, for example IterableOnce.


As you can see in the screenshots, the code in the Scala 3.8 version of this class already uses one of the new features: capture checking. Currently, the Scala plugin only supports basic syntax for capture checking, and even this support is experimental. Our goal was to enable you to navigate the Scala standard library code without encountering error highlighting, view type information for captures, and jump to their declarations.
The runtimeChecked method
The runtimeChecked method is an extension method defined in scala.Predef that can be called on any expression. When an expression ends with .runtimeChecked, it is exempt from certain static checks in the compiler, such as pattern match exhaustivity. The Scala plugin supports this feature out of the box. For example, if you write a pattern match that misses some cases – as in the screenshot below that defines all days of the week, but then uses only five of them in a match case – the Scala plugin displays a warning that the pattern matching is not exhaustive. If you decorate the value used for pattern matching with .runtimeChecked, the warning will not be displayed.

Looking ahead
The features highlighted in this article are where the Scala plugin’s support is most visible to users. However, there are numerous other changes we’ve made in preparation for the Scala 3.8 release. In the near future, we will continue to improve our Scala 3 support, including some of the new Scala 3.8 features. Expect more updates in the form of blog posts, release notes, and videos.
The features highlighted in this article are where the Scala plugin’s support is most visible to users. However, there are numerous other changes we’ve made in preparation for the Scala 3.8 release. In the near future, we will continue to improve our Scala 3 support, including some of the new Scala 3.8 features. Expect more updates in the form of blog posts, release notes, and videos.
As always, your feedback is invaluable. Please report any issues you encounter in YouTrack,, and feel free to share your questions, thoughts and suggestions on Discord.
We’re always happy to help.
Happy developing!
The Scala team at JetBrains