mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Tweak the error message on unexpectedly getting a non-type identifier. #1622
This commit is contained in:
@@ -477,7 +477,14 @@ static inline TypeInfo *parse_base_type(ParseContext *c)
|
||||
default:
|
||||
if (c->tok == TOKEN_IDENT)
|
||||
{
|
||||
PRINT_ERROR_HERE("A type name was expected, but this looks a variable or function name (as it doesn't start with an uppercase letter).");
|
||||
if (peek(c) == TOKEN_IDENT)
|
||||
{
|
||||
PRINT_ERROR_HERE("The name of a type must start with uppercase and contain at least one lowercase letter.");
|
||||
}
|
||||
else
|
||||
{
|
||||
PRINT_ERROR_HERE("A type name was expected, but this looks a variable or function name (as it doesn't start with an uppercase letter).");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
func1 a = 1; // #error: A type name was expected
|
||||
func1 a = 1; // #error: The name of a type
|
||||
|
||||
fn void func1() {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user