-
Notifications
You must be signed in to change notification settings - Fork 21
consider rename StringOps#lines. conflict jdk11 java.lang.String#lines #11125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
what should it be replaced with? |
Even if we change lines' signature, the risk still exists that the same problem will happen. |
Everyone wants to define |
In scala/scala-dev#557, I suggested to restore https://github.com/retronym/scala/tree/topic/linesIterator WDYT? |
Marking as a blocker as it can't be done in a minor release. |
|
A workaround, for those who don't need to use new parts of the Java standard library, is to use
I still 👍 for undeprecating |
(in the workaround ugliness-level sweepstakes, adding |
un-deprecating |
note that it isn't safe to rely on the compiler to catch bad uses of yes, often the compiler will catch it, e.g. but more devious is something like I guess a Scalafix rewrite could help here, and wouldn't have false positives if you are using |
this incurs a deprecation warning on 2.12.6, but we don't have fatal warnings enabled in this repo. the deprecation warnings will go away once we start building on 2.12.7.
use .linesIterator to work around scala/bug#11125
this incurs a deprecation warning on 2.12.6, but fatal warnings aren't enabled in this repo. the deprecation warnings will go away once the build moves to 2.12.7, which will undeprecate linesIterator
gah, we removed it's okay though, |
this incurs a deprecation warning on 2.12.6, but fatal warnings aren't enabled in this repo. the deprecation warnings will go away once the build moves to 2.12.7, which will undeprecate linesIterator
In JDK11 a method on `String` was added named `lines` which returned a `java.util.stream.Stream`. This collided with the enrichment method from Scala's `StringOps` class by the same name which returned an `Iterator`. The result, for metals, is that it was not possible to build metals using JDK11 or greater. This commit uses the new enrichment method `linesIterator` which was added to the Scala standard library as a replacement. This now enables metals to compile on JDK11. See: scala/bug#11125
Reported with #410 and reproduced with https://travis-ci.com/github/rtyley/bfg-repo-cleaner/builds/208827661 More about the underlying issue here: scala/bug#11125
The text was updated successfully, but these errors were encountered: