mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-01 02:42:05 +00:00
@@ -955,9 +955,9 @@ proc semCase(c: PContext, n: PNode; flags: TExprFlags): PNode =
|
||||
checkSonsLen(x, 1, c.config)
|
||||
x.sons[0] = semExprBranchScope(c, x.sons[0])
|
||||
typ = commonType(typ, x.sons[0])
|
||||
hasElse = true
|
||||
if chckCovered and covered == toCover(c, n.sons[0].typ):
|
||||
if (chckCovered and covered == toCover(c, n[0].typ)) or hasElse:
|
||||
localError(c.config, x.info, "invalid else, all cases are already covered")
|
||||
hasElse = true
|
||||
chckCovered = false
|
||||
else:
|
||||
illFormedAst(x, c.config)
|
||||
|
||||
Reference in New Issue
Block a user