fixes #22637; now --experimental:strictNotNil can be enabled globally (#23079)

fixes #22637
This commit is contained in:
ringabout
2023-12-16 14:05:57 +08:00
committed by GitHub
parent 0c3e703960
commit 9648d97a8d

View File

@@ -1247,10 +1247,10 @@ proc check(n: PNode, ctx: NilCheckerContext, map: NilMap): Check =
result = checkIf(n, ctx, map)
of nkAsgn, nkFastAsgn, nkSinkAsgn:
result = checkAsgn(n[0], n[1], ctx, map)
of nkVarSection:
of nkVarSection, nkLetSection:
result = Check(map: map)
for child in n:
result = checkAsgn(child[0], child[2], ctx, result.map)
result = checkAsgn(child[0].skipPragmaExpr, child[2], ctx, result.map)
of nkForStmt:
result = checkFor(n, ctx, map)
of nkCaseStmt: