parent
6b88cd0d42
commit
4ab6887a67
5 changed files with 32 additions and 24 deletions
|
|
@ -663,7 +663,7 @@ proc semRecordCase(c: PContext, n: PNode, check: var IntSet, pos: var int,
|
|||
internalError(c.config, "semRecordCase: discriminant is no symbol")
|
||||
return
|
||||
incl(a[0].sym.flags, sfDiscriminant)
|
||||
var covered: Int128 = toInt128(0)
|
||||
var covered = toInt128(0)
|
||||
var chckCovered = false
|
||||
var typ = skipTypes(a[0].typ, abstractVar-{tyTypeDesc})
|
||||
const shouldChckCovered = {tyInt..tyInt64, tyChar, tyEnum, tyUInt..tyUInt32, tyBool}
|
||||
|
|
@ -744,6 +744,8 @@ proc semRecordNodeAux(c: PContext, n: PNode, check: var IntSet, pos: var int,
|
|||
father.add n
|
||||
elif branch != nil:
|
||||
semRecordNodeAux(c, branch, check, pos, father, rectype, hasCaseFields)
|
||||
elif father.kind in {nkElse, nkOfBranch}:
|
||||
father.add newNodeI(nkRecList, n.info)
|
||||
of nkRecCase:
|
||||
semRecordCase(c, n, check, pos, father, rectype)
|
||||
of nkNilLit:
|
||||
|
|
@ -800,7 +802,9 @@ proc semRecordNodeAux(c: PContext, n: PNode, check: var IntSet, pos: var int,
|
|||
if containsOrIncl(check, n.sym.name.id):
|
||||
localError(c.config, n.info, "attempt to redefine: '" & n.sym.name.s & "'")
|
||||
father.add n
|
||||
of nkEmpty: discard
|
||||
of nkEmpty:
|
||||
if father.kind in {nkElse, nkOfBranch}:
|
||||
father.add n
|
||||
else: illFormedAst(n, c.config)
|
||||
|
||||
proc addInheritedFieldsAux(c: PContext, check: var IntSet, pos: var int,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue