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

[Draft][spec] Improve typing of br_if #532

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

[Draft][spec] Improve typing of br_if #532

wants to merge 1 commit into from

Commits on Mar 15, 2024

  1. [Draft][spec] Improve typing of br_if

    `br_if` previously had type `[t* i32] -> [t*]` where `[t*]` was the type of its
    target label. This typing unnecessarily lost type information in cases where the
    actual input result type is a strict subtype of the label result type,
    requiring casts to recover the types that the validation algorithm already knew
    about before the `br_if`.
    
    Update the type of `br_if` to be `[t1* i32] -> [t1*]` where `[t*]` is a subtype
    of the label type `[t*]`. This type preserves types that were present before the
    `br_if`, even when they are strict subsets of the label result types.
    
    Update the description of principle types in the appendix to allow type
    variables to be constrained by upper bounds and update the validation algorithm
    to reflect the new typing.
    
    This current PR illustrates the intended changes only for `br_if`, but the full
    intended change would similarly improve the types of `br_on_null`,
    `br_on_non_null`, `br_on_cast`, `br_on_cast_fail`, and `local.tee`.
    tlively committed Mar 15, 2024
    Configuration menu
    Copy the full SHA
    8b04c3c View commit details
    Browse the repository at this point in the history