Skip to content

[Bug] Default TypeMutator creates a new Global Type Var but the type checker relies on pointer equality #10265

@slyubomirsky

Description

@slyubomirsky

The default behavior of the Relay type mutator when it encounters Global Type Variables is to create a new Global Type Var instead of passing along the existing one. This can lead to type checking errors, as the type checker relies on pointer equality for global type vars (the type solver unifies them by checking for structural equality, and the structural equality check looks at pointer equality).

Proposed fix: Have the default return the global type var unmodified. Alternatively, we shouldn't use pointer equality for global type vars.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions