diff options
author | Araq <rumpf_a@web.de> | 2014-09-05 01:17:03 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-09-05 01:17:03 +0200 |
commit | bd4e2294640c634027f7a15d2a07eea21808dc61 (patch) | |
tree | 98d1f66e53ac305e1fbc249da4c65e19bb10789a /compiler/semstmts.nim | |
parent | bf557a7cdb8f31aabca17d5b147a90ec155eaf23 (diff) | |
parent | 7d5e387a488200113664a3ffa60e5c63ec32c54b (diff) | |
download | Nim-bd4e2294640c634027f7a15d2a07eea21808dc61.tar.gz |
Merge branch 'bigbreak' of https://github.com/Araq/Nimrod into bigbreak
Diffstat (limited to 'compiler/semstmts.nim')
-rw-r--r-- | compiler/semstmts.nim | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index 28d062392..93a1994a7 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -350,9 +350,14 @@ proc semVarOrLet(c: PContext, n: PNode, symkind: TSymKind): PNode = var def: PNode if a.sons[length-1].kind != nkEmpty: def = semExprWithType(c, a.sons[length-1], {efAllowDestructor}) - # BUGFIX: ``fitNode`` is needed here! - # check type compability between def.typ and typ: - if typ != nil: def = fitNode(c, typ, def) + if typ != nil: + if typ.isMetaType: + def = inferWithMetaType(c, typ, def) + typ = def.typ + else: + # BUGFIX: ``fitNode`` is needed here! + # check type compability between def.typ and typ + def = fitNode(c, typ, def) else: typ = skipIntLit(def.typ) if typ.kind in {tySequence, tyArray, tySet} and |