Print missing case labels (#10600)

This commit is contained in:
Arne Döring 2019-02-09 07:36:30 +01:00 • committed by Andreas Rumpf
commit 594c2576e6
4 changed files with 142 additions and 2 deletions

View file

@ -873,6 +873,9 @@ proc semCase(c: PContext, n: PNode; flags: TExprFlags): PNode =
if chckCovered:
if covered == toCover(c, n.sons[0].typ):
hasElse = true
elif n.sons[0].typ.kind == tyEnum:
localError(c.config, n.info, "not all cases are covered; missing: {$1}" %
formatMissingEnums(n))
else:
localError(c.config, n.info, "not all cases are covered")
closeScope(c)