diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2017-10-17 21:59:17 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-10-17 21:59:17 +0200 |
commit | e7f37d7223920939cda1a206cc84efee41952437 (patch) | |
tree | c5f28ec00c2ee0ea8a2ae23851559e9a1f663abf /compiler/semmagic.nim | |
parent | 58d5f9679028516b09bc2a2c0498e668f61cc8c9 (diff) | |
download | Nim-e7f37d7223920939cda1a206cc84efee41952437.tar.gz |
added typetraits.supportsCopyMem
Diffstat (limited to 'compiler/semmagic.nim')
-rw-r--r-- | compiler/semmagic.nim | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/semmagic.nim b/compiler/semmagic.nim index 8b3d9c014..88f1262ae 100644 --- a/compiler/semmagic.nim +++ b/compiler/semmagic.nim @@ -146,8 +146,13 @@ proc evalTypeTrait(traitCall: PNode, operand: PType, context: PSym): PNode = result = res.base.toNode(traitCall.info) of "stripGenericParams": result = uninstantiate(operand).toNode(traitCall.info) + of "supportsCopyMem": + let complexObj = containsGarbageCollectedRef(operand) or + hasDestructor(operand) + result = newIntNodeT(ord(not complexObj), traitCall) else: - internalAssert false + localError(traitCall.info, "unknown trait") + result = emptyNode proc semTypeTraits(c: PContext, n: PNode): PNode = checkMinSonsLen(n, 2) |