Closed as not planned
Description
Reproduction steps
Scala version: 2.13.11
Java version: 17.0.7
$ cat import_sun.scala
import sun._
$ scalac -deprecation -target:8 import_sun.scala
warning: -target is deprecated: Use -release instead to compile against the correct platform API.
1 warning
$ scalac -release:8 import_sun.scala
import_sun.scala:1: error: not found: object sun
import sun._
^
1 error
Problem
Compiling with the -target
flag gives a deprecation warning suggesting to use -release
instead. But switching using -release
means that the code no longer compiles.
If this is the intended behavior maybe the deprecation warnings/documentation should include more information of the differences between -target
and -release
.
Metadata
Metadata
Assignees
Labels
No labels