Print missing case labels (#10600)
This commit is contained in:
parent
bcbe130ea7
commit
594c2576e6
4 changed files with 142 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue