Skip to content

Create separate representations for specialized and unspecialized function literals #462

@dcreager

Description

@dcreager

We currently represent "class literals" and "class types" differently, which differ in how they handle generic classes. For a generic class, the class literal is unspecialized, and the class type is specialized.

We did not do the same thing for functions, thinking that it wasn't needed since specialized functions are ephemeral, only needed for the duration of checking a particular call of the specialized function. This is not true, though, for a method of a generic class, which should have the specialization of the class applied to its signature. (It's possible to "persist" this "generic" function via e.g. C[int].method.)

We should update the function representation to encode the same distinction. This will help with the property test failure in #459.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type propertiessubtyping, assignability, equivalence, and more

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions