Skip to content

String interpolation fails to compile running on JDK 20 when using release:11 compiler option #12761

Closed
scala/scala
#10359
@arixmkii

Description

@arixmkii

Reproduction steps

Scala version: 2.13.10

object A {
  def a(s: String): String = s"S: $s"
}

Problem

When trying to compile on JDK 20:

% java -version             
openjdk version "20" 2023-03-21
OpenJDK Runtime Environment Temurin-20+36 (build 20+36)
OpenJDK 64-Bit Server VM Temurin-20+36 (build 20+36, mixed mode)

% scala -version
Scala code runner version 2.13.10 -- Copyright 2002-2022, LAMP/EPFL and Lightbend, Inc.

% scalac -release:11 A.scala
error: Error while emitting A$
Unsupported class file major version 64
1 error

Compiles just fine with Temuring 17 JDK.

Platforms tested on:

  • macOS arm64

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions