use more meaningful name than "workaround14447" (#18237)

This commit is contained in:
Miran
2021-06-11 10:07:23 +02:00
committed by GitHub
parent c64d917619
commit 57609902c4
3 changed files with 3 additions and 3 deletions

View File

@@ -292,7 +292,7 @@ proc markAsClosure(g: ModuleGraph; owner: PSym; n: PNode) =
if illegalCapture(s):
localError(g.config, n.info,
("'$1' is of type <$2> which cannot be captured as it would violate memory" &
" safety, declared here: $3; using '-d:nimWorkaround14447' helps in some cases") %
" safety, declared here: $3; using '-d:nimNoLentIterators' helps in some cases") %
[s.name.s, typeToString(s.typ), g.config$s.info])
elif not (owner.typ.callConv == ccClosure or owner.typ.callConv == ccNimCall and tfExplicitCallConv notin owner.typ.flags):
localError(g.config, n.info, "illegal capture '$1' because '$2' has the calling convention: <$3>" %

View File

@@ -1,4 +1,4 @@
when defined(nimHasLentIterators) and not defined(nimWorkaround14447):
when defined(nimHasLentIterators) and not defined(nimNoLentIterators):
template lent2(T): untyped = lent T
else:
template lent2(T): untyped = T

View File

@@ -156,5 +156,5 @@ pkg "winim", allowFailure = true
pkg "with"
pkg "ws"
pkg "yaml", "nim build"
pkg "zero_functional", "nim c -r -d:nimWorkaround14447 test.nim"
pkg "zero_functional", "nim c -r -d:nimNoLentIterators test.nim"
pkg "zippy"