diff options
author | Clay Sweetser <clay.sweetser@gmail.com> | 2014-06-07 23:29:53 -0400 |
---|---|---|
committer | Clay Sweetser <clay.sweetser@gmail.com> | 2014-06-15 14:56:39 -0400 |
commit | ca1c516295e1711daf94e31f76d767efc27dc7a0 (patch) | |
tree | e44c9d63ef1f249b60cb247cf109659c1a30f259 | |
parent | 1658a29ec6bf24a4c144ad3cd36a41ebf35756ff (diff) | |
download | Nim-ca1c516295e1711daf94e31f76d767efc27dc7a0.tar.gz |
Fixing issue #1090
-rw-r--r-- | compiler/semstmts.nim | 3 | ||||
-rw-r--r-- | compiler/types.nim | 7 |
2 files changed, 7 insertions, 3 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index d17351988..11399b38b 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -828,6 +828,9 @@ proc typeSectionFinalPass(c: PContext, n: PNode) = getCurrOwner(), s.info) proc semTypeSection(c: PContext, n: PNode): PNode = + ## Processes a type section. This must be done in separate passes, in order + ## to allow the type definitions in the section to reference each other + ## without regard for the order of their definitions. typeSectionLeftSidePass(c, n) typeSectionRightSidePass(c, n) typeSectionFinalPass(c, n) diff --git a/compiler/types.nim b/compiler/types.nim index 1f266d64f..b2e131f60 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -1152,11 +1152,12 @@ proc computeRecSizeAux(n: PNode, a, currOffset: var BiggestInt): BiggestInt = result = computeSizeAux(n.sym.typ, a) n.sym.offset = int(currOffset) else: - internalError("computeRecSizeAux()") + # internalError("computeRecSizeAux()") + n.debug a = 1 - result = - 1 + result = - 2 -const +const szIllegalRecursion* = -2 szUnknownSize* = -1 |