Handle missing cases

This commit is contained in:
Rafał Grodziński
2025-07-04 18:16:03 +09:00
parent 2a5085cb21
commit a34325478c
2 changed files with 8 additions and 1 deletions

View File

@@ -222,7 +222,7 @@ shared_ptr<Statement> Parser::matchStatementFunction() {
shared_ptr<Token> returnTypeToken = tokens.at(currentIndex);
shared_ptr<ValueType> returnType = ValueType::valueTypeForToken(returnTypeToken);
if (returnType != nullptr) {
if (returnType == nullptr) {
markError(TokenKind::TYPE, {});
return nullptr;
}