Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Output type of local.tee? #201

Closed
Closed
@askeksa-google

Description

@askeksa-google

With the introduction of static subtyping, the input to a local.tee can be a subtype of the type of the local. This gives two obvious, sound choices for the output type:

  1. The type of the local. This is what follows from the typing rules for local.tee (same input, output and local type) combined with implicit upcasting of inputs.
  2. The actual type of the input. This is more useful, since it is more precise. On the other hand, it means that local.tee is not equivalent to local.set followed by local.get, and doing the substitution can break validation.

Currently, as far as I can tell, Binaryen implements (1) and V8 implements (2).

What is the intended behavior?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions