This commit is contained in:
Zahary Karadjov 2014-01-02 17:55:18 +02:00
commit 02533c260b
5 changed files with 126 additions and 37 deletions

View file

@ -86,7 +86,7 @@ include semdestruct
proc semDestructorCheck(c: PContext, n: PNode, flags: TExprFlags) {.inline.} =
if efAllowDestructor notin flags and n.kind in nkCallKinds+{nkObjConstr}:
if instantiateDestructor(c, n.typ):
if instantiateDestructor(c, n.typ) != nil:
localError(n.info, errGenerated,
"usage of a type with a destructor in a non destructible context")
# This still breaks too many things: