Skip to content

Extend alias.c arrow type short-circuit to TK_BOX and TK_TAG #4969

@SeanTAllen

Description

@SeanTAllen

In #4963, alias() in alias.c was given a short-circuit for val->A arrow types — since a val viewpoint always produces val or tag (both self-aliasing), aliasing inside the arrow is equivalent to aliasing outside it, so the arrow is returned unchanged.

The same reasoning applies to box->A and tag->A arrow types. box->X always produces box, val, or tag (all self-aliasing). tag->X always produces tag (self-aliasing). So alias(box->A) and alias(tag->A) could also short-circuit.

No stdlib code currently exercises these paths, so this is a latent issue — it would only surface if someone writes code with box->A or tag->A types that go through aliasing and the over-conservative result causes a type error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    discuss during syncShould be discussed during an upcoming sync

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions