* fixes #10940 * bug fixes * fix spacing
This commit is contained in:
parent
d5f2a5c204
commit
795de374fb
4 changed files with 56 additions and 3 deletions
|
|
@ -610,7 +610,7 @@ proc createTypeBoundOps*(c: PContext; orig: PType; info: TLineInfo) =
|
|||
## In the semantic pass this is called in strategic places
|
||||
## to ensure we lift assignment, destructors and moves properly.
|
||||
## The later 'injectdestructors' pass depends on it.
|
||||
if orig == nil or {tfCheckedForDestructor, tfHasMeta} * orig.flags != {}: return
|
||||
if orig == nil or {tfCheckedForDestructor, tfHasMeta} * orig.skipTypes({tyAlias}).flags != {}: return
|
||||
incl orig.flags, tfCheckedForDestructor
|
||||
|
||||
let h = sighashes.hashType(orig, {CoType, CoConsiderOwned})
|
||||
|
|
|
|||
|
|
@ -776,7 +776,12 @@ proc track(tracked: PEffects, n: PNode) =
|
|||
let last = lastSon(child)
|
||||
if last.kind != nkEmpty: track(tracked, last)
|
||||
if tracked.owner.kind != skMacro:
|
||||
createTypeBoundOps(tracked.c, child[0].typ, child.info)
|
||||
if child.kind == nkVarTuple:
|
||||
createTypeBoundOps(tracked.c, child[^1].typ, child.info)
|
||||
for i in 0..child.len-3:
|
||||
createTypeBoundOps(tracked.c, child[i].typ, child.info)
|
||||
else:
|
||||
createTypeBoundOps(tracked.c, child[0].typ, child.info)
|
||||
if child.kind == nkIdentDefs and last.kind != nkEmpty:
|
||||
for i in 0 .. child.len-3:
|
||||
initVar(tracked, child.sons[i], volatileCheck=false)
|
||||
|
|
|
|||
|
|
@ -2120,7 +2120,7 @@ proc semStmtList(c: PContext, n: PNode, flags: TExprFlags): PNode =
|
|||
continue
|
||||
|
||||
let verdict = semConstExpr(c, n[i])
|
||||
if verdict.intVal == 0:
|
||||
if verdict == nil or verdict.kind != nkIntLit or verdict.intVal == 0:
|
||||
localError(c.config, result.info, "concept predicate failed")
|
||||
of tyUnknown: continue
|
||||
else: discard
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue