summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorClay Sweetser <clay.sweetser@gmail.com>2014-06-15 20:01:48 -0400
committerClay Sweetser <clay.sweetser@gmail.com>2014-06-15 20:01:48 -0400
commit912ad820ee1127a595207d2067f0b6eeb0902dca (patch)
tree95a47a87dc9574651acd7950685cf9b778368162 /compiler
parentca1c516295e1711daf94e31f76d767efc27dc7a0 (diff)
downloadNim-912ad820ee1127a595207d2067f0b6eeb0902dca.tar.gz
Fixed #1090
Diffstat (limited to 'compiler')
-rw-r--r--compiler/types.nim15
1 files changed, 7 insertions, 8 deletions
diff --git a/compiler/types.nim b/compiler/types.nim
index b2e131f60..786eea14e 100644
--- a/compiler/types.nim
+++ b/compiler/types.nim
@@ -1118,6 +1118,11 @@ proc typeAllowed(t: PType, kind: TSymKind): bool =
 proc align(address, alignment: BiggestInt): BiggestInt = 
   result = (address + (alignment - 1)) and not (alignment - 1)
 
+const
+  szNonConcreteType* = -3
+  szIllegalRecursion* = -2
+  szUnknownSize* = -1
+
 proc computeSizeAux(typ: PType, a: var BiggestInt): BiggestInt
 proc computeRecSizeAux(n: PNode, a, currOffset: var BiggestInt): BiggestInt = 
   var maxAlign, maxSize, b, res: BiggestInt
@@ -1151,15 +1156,9 @@ proc computeRecSizeAux(n: PNode, a, currOffset: var BiggestInt): BiggestInt =
   of nkSym: 
     result = computeSizeAux(n.sym.typ, a)
     n.sym.offset = int(currOffset)
-  else: 
-    # internalError("computeRecSizeAux()")
-    n.debug
+  else:
     a = 1
-    result = - 2
-
-const
-  szIllegalRecursion* = -2
-  szUnknownSize* = -1
+    result = szNonConcreteType
 
 proc computeSizeAux(typ: PType, a: var BiggestInt): BiggestInt =
   var res, maxAlign, length, currOffset: BiggestInt