summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rwxr-xr-xcompiler/ecmasgen.nim6
-rwxr-xr-xcompiler/main.nim2
2 files changed, 4 insertions, 4 deletions
diff --git a/compiler/ecmasgen.nim b/compiler/ecmasgen.nim
index 8fc525a28..66f315dc3 100755
--- a/compiler/ecmasgen.nim
+++ b/compiler/ecmasgen.nim
@@ -940,8 +940,8 @@ proc createVar(p: var TProc, typ: PType, indirect: bool): PRope =
     result = putToSeq("0", indirect)
   of tyFloat..tyFloat128: 
     result = putToSeq("0.0", indirect)
-  of tyRange: 
-    result = createVar(p, typ.sons[0], indirect)
+  of tyRange, tyGenericInst: 
+    result = createVar(p, lastSon(typ), indirect)
   of tySet: 
     result = toRope("{}")
   of tyBool: 
@@ -979,7 +979,7 @@ proc createVar(p: var TProc, typ: PType, indirect: bool): PRope =
   of tyVar, tyPtr, tyRef: 
     if mapType(t) == etyBaseIndex: result = putToSeq("[null, 0]", indirect)
     else: result = putToSeq("null", indirect)
-  of tySequence, tyString, tyCString, tyPointer: 
+  of tySequence, tyString, tyCString, tyPointer, tyProc: 
     result = putToSeq("null", indirect)
   else: 
     internalError("createVar: " & $t.kind)
diff --git a/compiler/main.nim b/compiler/main.nim
index b7670f5aa..d08e94397 100755
--- a/compiler/main.nim
+++ b/compiler/main.nim
@@ -34,7 +34,7 @@ type
 
   TFileModuleMap = seq[TFileModuleRec]
 
-var compMods: TFileModuleMap = @ []
+var compMods: TFileModuleMap = @[]
 
 proc registerModule(filename: string, module: PSym) = 
   # all compiled modules