diff options
author | Jacek Sieka <arnetheduck@gmail.com> | 2016-04-26 21:25:57 +0800 |
---|---|---|
committer | Jacek Sieka <arnetheduck@gmail.com> | 2016-04-26 21:25:57 +0800 |
commit | ba1a52614b3feccaadadebf45cf897192902ed4d (patch) | |
tree | cd66f3d4ba01d25499aa452e68cd34c192804e9c /compiler/semexprs.nim | |
parent | a2501321c39a89fb0bad52dcb8ef7c974d4ae5d2 (diff) | |
parent | e31ec746b96ef185d9f5fa6276518949fa889e5a (diff) | |
download | Nim-ba1a52614b3feccaadadebf45cf897192902ed4d.tar.gz |
Merge remote-tracking branch 'origin/devel' into malloc-store-size
Diffstat (limited to 'compiler/semexprs.nim')
-rw-r--r-- | compiler/semexprs.nim | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 16b4ee479..3c4c453a9 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -74,8 +74,12 @@ proc semSymGenericInstantiation(c: PContext, n: PNode, s: PSym): PNode = proc inlineConst(n: PNode, s: PSym): PNode {.inline.} = result = copyTree(s.ast) - result.typ = s.typ - result.info = n.info + if result.isNil: + localError(n.info, "constant of type '" & typeToString(s.typ) & "' has no value") + result = newSymNode(s) + else: + result.typ = s.typ + result.info = n.info type TConvStatus = enum |