* closes #18690 * don't allow capturing of view types [backport]
This commit is contained in:
parent
f7d642f2f3
commit
7e5eab571e
2 changed files with 14 additions and 5 deletions
|
|
@ -12,7 +12,7 @@
|
|||
import
|
||||
intsets, strutils, options, ast, astalgo, msgs,
|
||||
idents, renderer, types, magicsys, lowerings, tables, modulegraphs, lineinfos,
|
||||
transf, liftdestructors
|
||||
transf, liftdestructors, typeallowed
|
||||
|
||||
discard """
|
||||
The basic approach is that captured vars need to be put on the heap and
|
||||
|
|
@ -191,9 +191,7 @@ proc interestingVar(s: PSym): bool {.inline.} =
|
|||
s.typ.kind notin {tyStatic, tyTypeDesc}
|
||||
|
||||
proc illegalCapture(s: PSym): bool {.inline.} =
|
||||
result = skipTypes(s.typ, abstractInst).kind in
|
||||
{tyVar, tyOpenArray, tyVarargs, tyLent} or
|
||||
s.kind == skResult
|
||||
result = classifyViewType(s.typ) != noView or s.kind == skResult
|
||||
|
||||
proc isInnerProc(s: PSym): bool =
|
||||
if s.kind in {skProc, skFunc, skMethod, skConverter, skIterator} and s.magic == mNone:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue