diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index 0ef1d0898f21..2fe8c55e4158 100644 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -204,7 +204,7 @@ proc hasValuelessStatics(n: PNode): bool = proc doThing(_: MyThing) ]# if n.safeLen == 0: - n.typ.kind == tyStatic + n.typ == nil or n.typ.kind == tyStatic else: for x in n: if hasValuelessStatics(x): diff --git a/tests/statictypes/tstatictypes.nim b/tests/statictypes/tstatictypes.nim index 5df3f35fd5e6..9b2d81b25896 100644 --- a/tests/statictypes/tstatictypes.nim +++ b/tests/statictypes/tstatictypes.nim @@ -391,3 +391,23 @@ var sorted = newSeq[int](1000) for i in 0..