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

Matching strings makes switches in bytecode #8451

Merged
merged 1 commit into from Nov 19, 2019
Merged

Commits on Oct 11, 2019

  1. Matching strings makes switches

    Switchable matches with string-typed scrutinee survive the pattern
    matcher in the same way as those on integer types do: as a series of
    `CaseDef`s with empty guard and literal pattern.
    
    Cleanup collates them by hash code and emits a switch on that.
    No sooner, so scala.js can emit a more JS-friendly implementation.
    
    Labels were used to avoid a proliferation of `throw new MatchError`.
    
    Works with nulls. Works with Unit.
    
    Enclosed "pos" test stands for positions, not positivity.
    
    Fixes scala/bug#11740
    
    Co-Authored-By: "Jason Zaugg" <jzaugg@gmail.com>
    hrhino and retronym committed Oct 11, 2019
    Configuration menu
    Copy the full SHA
    9f25ca0 View commit details
    Browse the repository at this point in the history