Neat-Lang / neat

The Neat Language compiler. Early beta?
BSD 3-Clause "New" or "Revised" License
111 stars 9 forks source link

Internal compiler error if you have an unparenthesized brace block in a case expression #68

Closed rsaarelm closed 7 months ago

rsaarelm commented 8 months ago

Crashes:

auto result = argParser.parse(args).case(Error: { usage(); return exit(1); });

Works:

auto result = argParser.parse(args).case(Error: ({ usage(); return exit(1); }));

The first one should work like the second one does.

FeepingCreature commented 7 months ago

The ({ }) syntax is straight up copied from gcc. That at least is intentional - blocks are not expressions.

Error fixed though:

    auto result = argParser.parse(args).case(Error: { usage(); return exit(1); });
                                                    ^ case expression expected