~sircmpwn/hare-dev

1

duplicated case on switch case using unions produces unhelpful error message

Details
Message ID
<69f7d48b-3a63-4c0e-be2c-1afe2b888849@yahoo.com>
DKIM signature
permerror
Download raw message
the example bellow will run the compilation progress until the end, then 
an error message with no line nor column or file name, will indicate a 
duplicated case on the switch block, which is visibly an bug but also 
really hard to spot where it happens.

type foo = enum {
     a, b, c, d
};

export fn main() void = {
     const bar = foo::a;
     switch(bar){
     case foo::a => void;
     case foo::b, foo::b, foo::c => void;
     case foo::d => void;
     };
};

<unknown>:0:0: error: Duplicate switch case

compiler version: harec 0.24.0-rc1-80-g42f9b39
Details
Message ID
<D32XHX80O94C.2LSCHVIBG0PFY@d2evs.net>
In-Reply-To
<69f7d48b-3a63-4c0e-be2c-1afe2b888849@yahoo.com> (view parent)
DKIM signature
pass
Download raw message
nice catch, sent a patch fixing this here:
https://lists.sr.ht/~sircmpwn/hare-dev/patches/54212
Reply to thread Export thread (mbox)