Additional fix and updated error message.

This commit is contained in:
Christoffer Lerno
2025-12-03 22:25:38 +01:00
parent cf5dd5496a
commit fd5489458a

View File

@@ -3074,7 +3074,6 @@ static inline bool parse_contract_param(ParseContext *c, AstId *docs, AstId **do
{
case TOKEN_IDENT:
case TOKEN_CT_IDENT:
case TOKEN_TYPE_IDENT:
case TOKEN_CT_TYPE_IDENT:
case TOKEN_HASH_IDENT:
ast->contract_stmt.param.name = symstr(c);
@@ -3082,8 +3081,10 @@ static inline bool parse_contract_param(ParseContext *c, AstId *docs, AstId **do
case TOKEN_ELLIPSIS:
ast->contract_stmt.param.name = NULL;
break;
case TOKEN_TYPE_IDENT:
case TOKEN_CT_CONST_IDENT:
case TOKEN_CONST_IDENT:
RETURN_PRINT_ERROR_HERE("This is not a valid parameter name.");
default:
RETURN_PRINT_ERROR_HERE("Expected a parameter name here.");
}