Skip to content

Offsetof submember does not work correctly #459

@bvdberg

Description

@bvdberg

The following code is accepted (but should not).
Also the following unit test expects the wrong diagnostic: test/expr/offsetof/offsetof_global12.c2

type S2 struct {
   i32 b;
}

type Foo struct {
   i32 aa;
   S2 s2;
}

fn void test1() {
   u32 off1 = offsetof(Foo, s2.aa); // accepted, should be error
   u32 off2 = offsetof(Foo, s2.b); // gives error: test.Foo has no member 'b';
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions