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

Support Match nodes with non-int-literals in the back-end. #3842

Merged
merged 1 commit into from
Nov 13, 2019

Commits on Nov 11, 2019

  1. Support Match nodes with non-int-literals in the back-end.

    Since Scala 2.13.2, the pattern matcher will keep `Match` nodes
    that match on `String`s and `null`s as is, to be desugared later
    in `cleanup`. This was implemented upstream in
    scala/scala#8451
    
    We implement a more general translation that will accept any kind
    of scalac `Literal`. If the scrutinee is an integer and all cases
    are int literals, we emit a `js.Match` as before. Otherwise, we
    emit an `if..else` chain with `===` comparisons.
    sjrd committed Nov 11, 2019
    Configuration menu
    Copy the full SHA
    24a22d1 View commit details
    Browse the repository at this point in the history