mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 20:11:17 +00:00
Improved error messages for foo(void), foo(int!) declarations.
This commit is contained in:
@@ -375,7 +375,7 @@ static inline bool parse_foreach_var(ParseContext *c, Ast *foreach)
|
||||
// If we don't get foreach (foo ... or foreach (*foo ... then a type is expected.
|
||||
if (!tok_is(c, TOKEN_IDENT) && !tok_is(c, TOKEN_AMP))
|
||||
{
|
||||
ASSIGN_TYPE_OR_RET(type, parse_failable_type(c), false);
|
||||
ASSIGN_TYPE_OR_RET(type, parse_optional_type(c), false);
|
||||
|
||||
// Add the failable to the type for nicer error reporting.
|
||||
RANGE_EXTEND_PREV(type);
|
||||
|
||||
Reference in New Issue
Block a user