This commit is contained in:
Araq 2013-05-18 23:41:44 +02:00
commit 9f6547ba63
4 changed files with 28 additions and 15 deletions

View file

@ -89,6 +89,8 @@ proc semDestructorCheck(c: PContext, n: PNode, flags: TExprFlags) {.inline.} =
if instantiateDestructor(c, n.typ):
LocalError(n.info, errGenerated,
"usage of a type with a destructor in a non destructible context")
if efDetermineType notin flags and n.typ.kind == tyTypeDesc:
localError(n.info, errGenerated, "value expected, but got a type")
proc newDeref(n: PNode): PNode {.inline.} =
result = newNodeIT(nkHiddenDeref, n.info, n.typ.sons[0])