Skip to content
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

Catch up with Scala 2.13.4 #4276

Merged
merged 3 commits into from Nov 7, 2020
Merged

Catch up with Scala 2.13.4 #4276

merged 3 commits into from Nov 7, 2020

Conversation

sjrd
Copy link
Member

@sjrd sjrd commented Nov 5, 2020

  • Use CharBuffer.wrap to get a CharSequence from an Array[Char].
  • Address new warnings with the stricter patmat exhaustivity of 2.13.4.
  • Adapt MatchASTTest for Scala 2.13.4.

Supersedes #4272 now that scala/scala#9299 upstream tuned down most of the warnings. Also address two other incompatibilities with 2.13.4.

Locally tested with

> set resolvers in Global += "scala-integration" at "https://scala-ci.typesafe.com/artifactory/scala-integration/"
> ++2.13.4-bin-e6a6ac6
> testSuite2_13/test:compile # with manual inspection of the warnings in the test suite
> testSuite2_13/test
> testSuiteEx2_13/test
> compiler2_13/test
> ir2_13/test
> linker2_13/test
> testSuite2_13/bootstrap:test

The implicit conversion in `Predef` was made non-implicit in Scala
2.13.4, because of issues on JDK15+. We could explicitly call it,
but the recommended replacement is to use `CharBuffer.wrap`.
Copy link
Contributor

@gzm0 gzm0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only a minor nit.

In 2.13.4, the pattern match exhaustivity analysis has become
stricter. It remains active in the presence of guards and custom
extractors (including `unapplySeq`). This change causes some new
warnings in our codebase, which this commit addresses.

See scala/scala#9140, which was somewhat
toned down by scala/scala#9299.
Something seems to have changed in Scala 2.13.4 that optimizes
`match`es whose scrutinee is a literal, causing two (similar) tests
to fail. Since the literal scrutinee was not the point of those
tests, we move it to another `def`.
@sjrd sjrd merged commit 9348e8f into scala-js:master Nov 7, 2020
@sjrd sjrd deleted the catch-up-with-2.13.4 branch November 7, 2020 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants