In the Scala 2 community build, when we started running it on JDK 23, I noticed that a number of projects that did:
import java.io.*
import cats.effect.*
and then referenced IO
stopped compiling because java.io.IO
is new in JDK 23 and thus the wildcard imports became ambiguous.
For the record, the problem is solvable by changing the latter import to import cats.effect.{IO, *}
. Because the import of IO
is explicit rather than merely part of a wildcard, it takes precedence.
Note that avoiding the clash with import java.io.{IO => _, *}
instead does work on JDK 23+, but fails compilation on earlier JDKs, so that’s probably not what you want.