Skip to content

Should impl lookup distinguish and/or fallback on const and/or MaybeUnformed? #6068

@jonmeow

Description

@jonmeow

Regarding generic type structure here, it gives several rules, particularly:

  • Pointer types T* are replaced with Ptr(T).

Right now, MaybeUnformed is implemented as a class, so is part of the type structure. Although the design doesn't current specify, I'm going to assume here that const and partial should be part of the type structure.

Should there be any impl lookup fallbacks in this space? In particular:

  1. Can impl const MyType as Comparable be used for a non-const MyType?
  2. Can impl MaybeUnformed(MyType) as Comparable be used for a formed MyType?
  3. If the answer is yes to both of the above, does that extend to MaybeUnformed(const MyType) and/or const MaybeUnformed(MyType)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    leads questionA question for the leads team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions