Make error message for empty new-styled concept more descriptive (#18506)

* Allow empty new-styled concept

Slightly improve error messages

* Make empty new-styled concepts an error
This commit is contained in:
konsumlamm 2021-07-18 10:49:03 +02:00 • committed by GitHub
commit ac5435ecd0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 11 deletions

View file

@ -2058,6 +2058,8 @@ proc parseTypeClass(p: var Parser): PNode =
skipComment(p, result)
# an initial IND{>} HAS to follow:
if not realInd(p):
if result.isNewStyleConcept:
parMessage(p, "routine expected, but found '$1' (empty new-styled concepts are not allowed)", p.tok)
result.add(p.emptyNode)
else:
result.add(parseStmt(p))