diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/parse/types.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/parse/types.cpp b/src/parse/types.cpp index 23101dba..aa29af64 100644 --- a/src/parse/types.cpp +++ b/src/parse/types.cpp @@ -46,6 +46,9 @@ TypeRef Parse_Type(TokenStream& lex) switch( GET_TOK(tok, lex) ) { + // '!' - Only ever used as part of function prototypes, but is kinda a type... not allowed here though + case TOK_EXCLAM: + throw ParseError::Generic(lex, "! is not a real type"); // '_' = Wildcard (type inferrence variable) case TOK_UNDERSCORE: return TypeRef(); @@ -185,8 +188,6 @@ TypeRef Parse_Type(TokenStream& lex) CHECK_TOK(tok, TOK_PAREN_CLOSE); return TypeRef(TypeRef::TagTuple(), types); } } - case TOK_EXCLAM: - throw ParseError::Generic(lex, "! is not a real type"); default: throw ParseError::Unexpected(lex, tok); } |