Skip to content

Does struct field order matter for impl lookup and type structure? #5413

Open
@danakj

Description

@danakj

Summary of issue:

interface Z {
  let X:! type;
}
impl {.a: (), .b: ()} as Z where .X = i32 {}
impl {.b: (), .a: ()} as Z where .X = i64 {}

fn F() {
  let x: auto = 1 as ({.a: (), .b: ()} as Z).X;
  let y: auto = 1 as ({.b: (), .a: ()} as Z).X;
}

Is this an error because the two impls overlap? If not, is the type of x i32 and the type of y i64?

Details:

No response

Any other information that you want to share?

No response

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