non-destructible context only produces a warning for now
This commit is contained in:
parent
afd8a902a9
commit
995510664e
2 changed files with 7 additions and 6 deletions
|
|
@ -92,10 +92,10 @@ proc semProc(c: PContext, n: PNode): PNode
|
|||
include semdestruct
|
||||
|
||||
proc semDestructorCheck(c: PContext, n: PNode, flags: TExprFlags) {.inline.} =
|
||||
if efAllowDestructor notin flags and n.kind in nkCallKinds+{nkObjConstr}:
|
||||
if efAllowDestructor notin flags and
|
||||
n.kind in nkCallKinds+{nkObjConstr,nkBracket}:
|
||||
if instantiateDestructor(c, n.typ) != nil:
|
||||
localError(n.info, errGenerated,
|
||||
"usage of a type with a destructor in a non destructible context")
|
||||
localError(n.info, warnDestructor)
|
||||
# This still breaks too many things:
|
||||
when false:
|
||||
if efDetermineType notin flags and n.typ.kind == tyTypeDesc and
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue