diff options
author | Zahary Karadjov <zahary@gmail.com> | 2014-03-08 22:57:06 +0200 |
---|---|---|
committer | Zahary Karadjov <zahary@gmail.com> | 2014-03-08 22:57:06 +0200 |
commit | 085b339b8b12267cb8ed555979db368e151c9ca4 (patch) | |
tree | ca2b34fe9cb94a72319892144a922221b66219d5 /compiler/semtypinst.nim | |
parent | 2cbe46daff73987d819ea0ca4bc6ada919d531d4 (diff) | |
download | Nim-085b339b8b12267cb8ed555979db368e151c9ca4.tar.gz |
implements higher-order inline iterators and return type inference for iterators
Diffstat (limited to 'compiler/semtypinst.nim')
-rw-r--r-- | compiler/semtypinst.nim | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index 22edc6e32..46ec31d90 100644 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -305,6 +305,11 @@ proc skipIntLiteralParams(t: PType) = if skipped != p: t.sons[i] = skipped if i > 0: t.n.sons[i].sym.typ = skipped + + # when the typeof operator is used on a static input + # param, the results gets infected with static as well: + if t.sons[0] != nil and t.sons[0].kind == tyStatic: + t.sons[0] = t.sons[0].base proc propagateFieldFlags(t: PType, n: PNode) = # This is meant for objects and tuples @@ -323,7 +328,7 @@ proc replaceTypeVarsTAux(cl: var TReplTypeVars, t: PType): PType = result = t if t == nil: return - if t.kind in {tyStatic, tyGenericParam} + tyTypeClasses: + if t.kind in {tyStatic, tyGenericParam, tyIter} + tyTypeClasses: let lookup = PType(idTableGet(cl.typeMap, t)) if lookup != nil: return lookup |