diff --git a/compiler/icnif/nifencoder.nim b/compiler/icnif/nifencoder.nim index 0903144c80..dccdcbd08d 100644 --- a/compiler/icnif/nifencoder.nim +++ b/compiler/icnif/nifencoder.nim @@ -99,6 +99,7 @@ proc toNifDef(c: var EncodeContext; typ: PType) = c.dest.buildTree sonsTag: for ch in typ.kids: c.toNif ch + c.toNif typ.n c.toNif typ.owner c.toNif typ.sym @@ -188,7 +189,7 @@ proc toNif(c: var EncodeContext; n: PNode) = c.withNode n: discard else: - assert n.kind in {nkArgList, nkBracket} or n.len > 0, $n.kind + assert n.kind in {nkArgList, nkBracket, nkRecList} or n.len > 0, $n.kind c.withNode(n): for i in 0 ..< n.len: c.toNif n[i] diff --git a/tests/icnif/testcode/modtesttypesections.nim b/tests/icnif/testcode/modtesttypesections.nim index 7ff5b0e5be..d858b5af9a 100644 --- a/tests/icnif/testcode/modtesttypesections.nim +++ b/tests/icnif/testcode/modtesttypesections.nim @@ -21,6 +21,8 @@ type TestPtrObj = ptr object x: int + TestEmptyObj = object + var x: TestInt var testEnum: TestEnum var testEnum1 = X @@ -34,3 +36,4 @@ var testPtrInt: TestPtrInt = nil var testPtrInt2: ptr int = nil var testRefObj: TestRefObj = nil var testPtrObj: TestPtrObj = nil +var testEmptyObj: TestEmptyObj