Skip to content

Text Format: Clarify symbolic identifiers on function type parameters aren't to be used #1411

Closed

Description

@codefromthecrypt

Currently, the text format defines not only a symbolic identifier for a type, but also, via functype, symbolic identifiers for params. There is ambiguity in the Type Uses documentation caused by this. For example, when one references a type by index, shouldn't its param IDs be inherited if not explicitly overridden?

Ex. one could reasonably think they should.

(type $filter (func (param $offset i32) (param $count i32)))

(func $nop_filter (type $filter) ...)

However, via a discussion with @alexcrichton and @rossberg, it seems the parameter IDs on a type are not intended to be used anywhere. I think there should be a spec or doc change as a result and don't mind either.

a. Remove symbolic param IDs on a function type definition. That removes the ambiguity and eliminates currently useless IDs. If someone wants to document, they can use comments
b. Clarify in the "Type Uses" note that any param IDs on a type referenced by index are to be ignored when binding the symbolic index of locals (and the name section for that matter).

Activity

  1. rossberg commented on Jan 27, 2022

    @rossberg
    Member

    See #1412 for route (b). The other would be a breaking change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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