parent
7939319379
commit
2fee89f7db
1 changed files with 2 additions and 2 deletions
|
|
@ -945,9 +945,9 @@ proc semCase(c: PContext, n: PNode; flags: TExprFlags): PNode =
|
||||||
checkSonsLen(x, 1, c.config)
|
checkSonsLen(x, 1, c.config)
|
||||||
x[0] = semExprBranchScope(c, x[0])
|
x[0] = semExprBranchScope(c, x[0])
|
||||||
typ = commonType(typ, x[0])
|
typ = commonType(typ, x[0])
|
||||||
hasElse = true
|
if (chckCovered and covered == toCover(c, n[0].typ)) or hasElse:
|
||||||
if chckCovered and covered == toCover(c, n[0].typ):
|
|
||||||
localError(c.config, x.info, "invalid else, all cases are already covered")
|
localError(c.config, x.info, "invalid else, all cases are already covered")
|
||||||
|
hasElse = true
|
||||||
chckCovered = false
|
chckCovered = false
|
||||||
else:
|
else:
|
||||||
illFormedAst(x, c.config)
|
illFormedAst(x, c.config)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue