usage of NimNode triggers .compileTime context; fixes #1679

This commit is contained in:
Araq 2015-09-14 12:41:49 +02:00
commit 612cd25d5d
5 changed files with 16 additions and 2 deletions

View file

@ -477,6 +477,8 @@ type
# wildcard type.
tfHasAsgn # type has overloaded assignment operator
tfBorrowDot # distinct type borrows '.'
tfTriggersCompileTime # uses the NimNode type which make the proc
# implicitly '.compiletime'
TTypeFlags* = set[TTypeFlag]
@ -1380,6 +1382,9 @@ proc propagateToOwner*(owner, elem: PType) =
o2.flags.incl tfHasAsgn
owner.flags.incl tfHasAsgn
if tfTriggersCompileTime in elem.flags:
owner.flags.incl tfTriggersCompileTime
if owner.kind notin {tyProc, tyGenericInst, tyGenericBody,
tyGenericInvocation, tyPtr}:
let elemB = elem.skipTypes({tyGenericInst})