~sircmpwn/hare#929: 
Miscompilation when accessing a struct/tuple pointer's field at compile-time

harec should error out here, but instead it compiles as though b were a struct rather than a pointer:

let a = struct { x: int = 1, y: int = 2 };
let b = &a;
let c = &b.y;

export fn main() void = {
    assert(*c == 2); // fails
};

The same happens for tuples (initialize a to (1, 2) and c to &b.1).

Status
RESOLVED FIXED
Submitter
~sebsite
Assigned to
No-one
Submitted
1 year, 3 months ago
Updated
10 months ago
Labels
bug easy harec

~turminal REPORTED FIXED 11 months ago

Alexey Yerin referenced this ticket in commit 68d8440.

~ecs 10 months ago

Alexey Yerin referenced this ticket in commit 68d8440.

Register here or Log in to comment, or comment via email.