mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Update to error message when expecting a type.
This commit is contained in:
@@ -464,7 +464,14 @@ static inline TypeInfo *parse_base_type(ParseContext *c)
|
||||
type_found = type_from_token(c->tok);
|
||||
break;
|
||||
default:
|
||||
SEMA_ERROR_HERE("A type name was expected here.");
|
||||
if (c->tok == TOKEN_IDENT)
|
||||
{
|
||||
SEMA_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
|
||||
{
|
||||
SEMA_ERROR_HERE("A type name was expected here.");
|
||||
}
|
||||
return poisoned_type_info;
|
||||
}
|
||||
if (type_found)
|
||||
|
||||
@@ -11,7 +11,7 @@ def fn foo = fef; // #error: A type, variable, constant or attribute name was ex
|
||||
def feokfe = fn void(int); // #error: Expected a function or variable name here
|
||||
def AOFKE = ofek; // #error: Expected a constant name here
|
||||
def okfoe = OFKEOK; // #error: Expected a function or variable name here
|
||||
def Helo = helo; // #error: A type name was expected here
|
||||
def Helo = helo; // #error: A type name was expected, but this looks a variable
|
||||
def Helo = OFKE; // #error: A type name was expected here
|
||||
def helo = Helo; // #error: A type alias must start with an uppercase letter and contain at least one lower case letter.
|
||||
def HELO = Helo; // #error: A type alias must start with an uppercase letter and contain at least one lower case letter.
|
||||
|
||||
Reference in New Issue
Block a user