diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2017-03-03 13:00:09 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-03-03 13:00:09 +0100 |
commit | 5d125ca716b83abd850a5f270085a755dbd4c80c (patch) | |
tree | a5d4f6662b02fafb0a819e91056ad6e472883fb4 /compiler | |
parent | 3b0430bec6be70e3312914d6034963319f860591 (diff) | |
parent | a42801d100c2ec33b93af89f7fd2b17cfe5d4fbc (diff) | |
download | Nim-5d125ca716b83abd850a5f270085a755dbd4c80c.tar.gz |
Merge branch 'devel' into faster-nimsuggest
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/ccgutils.nim | 2 | ||||
-rw-r--r-- | compiler/vmdeps.nim | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/compiler/ccgutils.nim b/compiler/ccgutils.nim index 46a9177ad..ff8f768bd 100644 --- a/compiler/ccgutils.nim +++ b/compiler/ccgutils.nim @@ -181,7 +181,7 @@ proc mangle*(name: string): string = of '_': # we generate names like 'foo_9' for scope disambiguations and so # disallow this here: - if i < name.len-1 and name[i+1] in Digits: + if i > 0 and i < name.len-1 and name[i+1] in Digits: discard else: add(result, c) diff --git a/compiler/vmdeps.nim b/compiler/vmdeps.nim index ebd2f557f..779d6d2a4 100644 --- a/compiler/vmdeps.nim +++ b/compiler/vmdeps.nim @@ -218,8 +218,13 @@ proc mapTypeToAstX(t: PType; info: TLineInfo; of tyTuple: if inst: result = newNodeX(nkTupleTy) - for s in t.n.sons: - result.add newIdentDefs(s) + # only named tuples have a node, unnamed tuples don't + if t.n.isNil: + for subType in t.sons: + result.add mapTypeToAst(subType, info) + else: + for s in t.n.sons: + result.add newIdentDefs(s) else: result = mapTypeToBracket("tuple", mTuple, t, info) of tySet: result = mapTypeToBracket("set", mSet, t, info) |