Skip to content

String#split(Char) extension method stopped working on JDK 14 #8838

Closed
@SethTisue

Description

@SethTisue

it's fine on 8, 11, and 13

sbt:euler> show scalaVersion
[info] 0.24.0-RC1
sbt:euler> console

scala> System.getProperty("java.version")                                                               
val res0: String = 14.0.1

scala> "foo".split(' ')
1 |"foo".split(' ')
  |            ^^^
  |            Found:    (' ' : Char)
  |            Required: String

this can also be seen when Dotty tries to build itself on 14:

[error] -- [E007] Type Mismatch Error: /Users/tisue/dotty/doc-tool/src/dotty/tools/dottydoc/staticsite/DefaultParams.scala:72:38 
[error] 72 |  val path: Array[String] = url.split('/').drop(1)
[error]    |                                      ^^^
[error]    |                                      Found:    ('/' : Char)
[error]    |                                      Required: String
[error] one error found

the problem also exists in 0.23.0-RC1; I didn't try testing farther back than that

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions