summary refs log tree commit diff stats
path: root/compiler/ccgexprs.nim
diff options
context:
space:
mode:
authorzah <zahary@gmail.com>2020-03-26 10:26:19 +0200
committerGitHub <noreply@github.com>2020-03-26 09:26:19 +0100
commite50441ab33d1b287a89ad4e2d795c80b7f8077c0 (patch)
tree3cb06dd6cf0018a57eb12c65a6565fda60ccebd6 /compiler/ccgexprs.nim
parent1b31e08917f3644b80a10b581089b816ef2db214 (diff)
downloadNim-e50441ab33d1b287a89ad4e2d795c80b7f8077c0.tar.gz
Fix typeSym.getImpl for ref types (#13752)
* Fix typeSym.getImpl for ref types

* Fix a codegen issue affecting the test suite of nim-beacon-chain

* Fix tests/stdlib/tjsonmacro

To understand the fix better it may help to take a look
at the history of the replaced code.

The nil check that is removed in this commit was introduced
in another fix that failed to identify the root cause of the
issue - namely that we allow an object type to exist for which
no ast is present:

https://github.com/nim-lang/Nim/pull/9601/files

The original intention of the code is more obvious here:

https://github.com/nim-lang/Nim/pull/9538/files
Diffstat (limited to 'compiler/ccgexprs.nim')
-rw-r--r--compiler/ccgexprs.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim
index e1561ae12..fcedcf001 100644
--- a/compiler/ccgexprs.nim
+++ b/compiler/ccgexprs.nim
@@ -2950,7 +2950,7 @@ proc genBracedInit(p: BProc, n: PNode; isConst: bool): Rope =
       else:
         internalError(p.config, n.info, "node has no type")
     else:
-      ty = skipTypes(n.typ, abstractInstOwned).kind
+      ty = skipTypes(n.typ, abstractInstOwned + {tyStatic}).kind
     case ty
     of tySet:
       var cs: TBitSet