diff options
author | Yuriy Glukhov <yuriy.glukhov@gmail.com> | 2015-09-14 14:25:40 +0300 |
---|---|---|
committer | Yuriy Glukhov <yuriy.glukhov@gmail.com> | 2015-09-14 14:30:08 +0300 |
commit | aeff57627b6165f3ba75d10f2aba5147fb686e8d (patch) | |
tree | 9785ff9fc6a6c257c6b0124dede2ef2ec6b3bb7f /compiler | |
parent | 148bbee05f31802666dbf1730e0df328ff57a384 (diff) | |
download | Nim-aeff57627b6165f3ba75d10f2aba5147fb686e8d.tar.gz |
Fixed JS gen for generic array types.
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/jstypes.nim | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/jstypes.nim b/compiler/jstypes.nim index 851938327..832d9996c 100644 --- a/compiler/jstypes.nim +++ b/compiler/jstypes.nim @@ -116,8 +116,7 @@ proc genEnumInfo(p: PProc, typ: PType, name: Rope) = [name, genTypeInfo(p, typ.sons[0])]) proc genTypeInfo(p: PProc, typ: PType): Rope = - var t = typ - if t.kind == tyGenericInst: t = lastSon(t) + let t = typ.skipTypes({tyGenericInst}) result = "NTI$1" % [rope(t.id)] if containsOrIncl(p.g.typeInfoGenerated, t.id): return case t.kind @@ -141,7 +140,7 @@ proc genTypeInfo(p: PProc, typ: PType): Rope = [result, rope(ord(t.kind))] prepend(p.g.typeInfo, s) addf(p.g.typeInfo, "$1.base = $2;$n", - [result, genTypeInfo(p, typ.sons[1])]) + [result, genTypeInfo(p, t.sons[1])]) of tyEnum: genEnumInfo(p, t, result) of tyObject: genObjectInfo(p, t, result) of tyTuple: genTupleInfo(p, t, result) |