summary refs log tree commit diff stats
path: root/compiler/semdata.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-04-01 01:01:25 +0200
committerAraq <rumpf_a@web.de>2012-04-01 01:01:25 +0200
commitf788f603feed91a1740e30852a56a2a6fda0ac05 (patch)
tree38c2dbb34a704bd97fe790d2f135a4346e617109 /compiler/semdata.nim
parent3ef9f54cc128e8a4875803c5b686aedc06a397d1 (diff)
parent8d698b2bdd63cb7390a418d9ebb3ee7fdc7ea3b5 (diff)
downloadNim-f788f603feed91a1740e30852a56a2a6fda0ac05.tar.gz
Merge branch 'master' of github.com:Araq/Nimrod
Diffstat (limited to 'compiler/semdata.nim')
-rwxr-xr-xcompiler/semdata.nim10
1 files changed, 6 insertions, 4 deletions
diff --git a/compiler/semdata.nim b/compiler/semdata.nim
index 49ab20290..80aed2fd4 100755
--- a/compiler/semdata.nim
+++ b/compiler/semdata.nim
@@ -180,14 +180,16 @@ proc addToLib(lib: PLib, sym: PSym) =
   sym.annex = lib
 
 proc makePtrType(c: PContext, baseType: PType): PType = 
-  if (baseType == nil): InternalError("makePtrType")
   result = newTypeS(tyPtr, c)
-  addSon(result, baseType)
+  addSon(result, baseType.AssertNotNil)
 
 proc makeVarType(c: PContext, baseType: PType): PType = 
-  if (baseType == nil): InternalError("makeVarType")
   result = newTypeS(tyVar, c)
-  addSon(result, baseType)
+  addSon(result, baseType.AssertNotNil)
+
+proc makeTypeDesc*(c: PContext, typ: PType): PType =
+  result = newTypeS(tyTypeDesc, c)
+  result.addSon(typ.AssertNotNil)
 
 proc newTypeS(kind: TTypeKind, c: PContext): PType = 
   result = newType(kind, getCurrOwner())