-
Notifications
You must be signed in to change notification settings - Fork 554
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
Scala 2.13: Fix various syntax errors #25425
Commits on Aug 23, 2022
-
Remove call in deprecated
seq
method of IterableTo get rid of this error: ``` [error] /Users/Ioanna_Kokkini/Projects/frontend/admin/app/tools/charts/charts.scala:50:15: method seq in trait Iterable is deprecated (since 2.13.0): Iterable.seq always returns the iterable itself [error] chartRows.seq [error] ^ ```
Configuration menu - View commit details
-
Copy full SHA for ebc0672 - Browse repository at this point
Copy the full SHA ebc0672View commit details -
Replace deprecated unicode escapes in triple quoted strings
To get rid of the error: ``` [error] /Users/Ioanna_Kokkini/Projects/frontend/common/app/common/StringEncodings.scala:19:22: Unicode escapes in triple quoted strings are deprecated, use the literal character instead [error] .replaceAll("""\u2028""", """\\u2028""") [error] ^ [error] /Users/Ioanna_Kokkini/Projects/frontend/common/app/common/StringEncodings.scala:20:22: Unicode escapes in triple quoted strings are deprecated, use the literal character instead [error] .replaceAll("""\u2029""", """\\u2029""") ```
Configuration menu - View commit details
-
Copy full SHA for b596f2c - Browse repository at this point
Copy the full SHA b596f2cView commit details -
Use linesIterator on String instead of lines on a WrappedString
`lines` is not a method of `WrappedString` anymore but we can call `linesIterator` on a String after it has been undeprecated in this PR: scala/scala#7269 This way we get rid of the following error: ``` [error] /Users/Ioanna_Kokkini/Projects/frontend/common/app/common/TrailsToShowcase.scala:509:46: value lines is not a member of scala.collection.immutable.WrappedString [error] val lines = new WrappedString(trailText).lines.toSeq [error] ^ [error] one error found ```
Configuration menu - View commit details
-
Copy full SHA for 9993fb3 - Browse repository at this point
Copy the full SHA 9993fb3View commit details -
Be strict about using a Long value
Scala 2.13 compiler does not recoginise this is Long anymore so we have to be more specific. ``` [error] /Users/Ioanna_Kokkini/Projects/frontend/common/app/common/configuration.scala:213:95: type mismatch; [error] found : AnyVal [error] required: Long [error] Duration.create(configuration.getIntegerProperty("content.api.timeout.millis").getOrElse(2000), MILLISECONDS) [error] ```
Configuration menu - View commit details
-
Copy full SHA for 53e894d - Browse repository at this point
Copy the full SHA 53e894dView commit details -
Replace deprecated Traversable with Iterable
To get rid of the following error: ``` [error] /Users/Ioanna_Kokkini/Projects/frontend/common/app/model/Badges.scala:174:26: type Traversable in package scala is deprecated (since 2.13.0): Use Iterable instead of Traversable [error] def badgeForTags(tags: Traversable[String]): Option[Badge] = { [error] ```
Configuration menu - View commit details
-
Copy full SHA for 7aaf61a - Browse repository at this point
Copy the full SHA 7aaf61aView commit details -
Replace deprecated Stream with LazyList
To get rid of the following error: ``` [error] /Users/Ioanna_Kokkini/Projects/frontend/common/app/model/CrosswordGridModel.scala:18:30: value Stream in package scala is deprecated (since 2.13.0): Use LazyList instead of Stream [error] (('A' to 'Z').toList.zip(Stream from 0) map { case (letter, number) => (number, letter) }).toMap [error] ```
Configuration menu - View commit details
-
Copy full SHA for 027bd32 - Browse repository at this point
Copy the full SHA 027bd32View commit details -
Add @uncheched in superfluous pattern matching check
Scala 2.13 compiler is stricter in checking whether pattern matching has been exhaustive but in this case we don't need to check for `Nil` because split() never gives the empty list. To get rid off the following error: ``` [error] /Users/Ioanna_Kokkini/Projects/frontend/common/app/model/facia.scala:24:21: match may not be exhaustive. [error] It would fail on the following input: Nil [error] path.split('/').toList match { [error] ^ ```
Configuration menu - View commit details
-
Copy full SHA for 2fbfdcf - Browse repository at this point
Copy the full SHA 2fbfdcfView commit details -
Replace deprecated method replaceAllLiterally with replace in a Strin…
…gOps To get rid of the following error: ``` [error] /Users/Ioanna_Kokkini/Projects/frontend/common/app/pagepresser/HtmlCleaner.scala:200:9: method replaceAllLiterally in class StringOps is deprecated (since 2.13.2): Use `s.replace` as an exact replacement [error] src.replaceAllLiterally("http://", "//") [error] ^ ```
Configuration menu - View commit details
-
Copy full SHA for 344573f - Browse repository at this point
Copy the full SHA 344573fView commit details