diff options
author | Araq <rumpf_a@web.de> | 2011-06-29 19:14:35 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2011-06-29 19:14:35 +0200 |
commit | 170573a87f0df749bdb91126c930826ba5329e95 (patch) | |
tree | 009732110eb44af1ccea5bf8902594a1a22e9c0b /compiler | |
parent | 5c94a9e1aea4a25fd9909adf464d9edf3b7ac526 (diff) | |
download | Nim-170573a87f0df749bdb91126c930826ba5329e95.tar.gz |
bugfix: subranges in generics properly detected
Diffstat (limited to 'compiler')
-rwxr-xr-x | compiler/trees.nim | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/trees.nim b/compiler/trees.nim index 3c8775b87..76a30e3ac 100755 --- a/compiler/trees.nim +++ b/compiler/trees.nim @@ -141,6 +141,8 @@ proc SwapOperands(op: PNode) = op.sons[2] = tmp proc IsRange*(n: PNode): bool {.inline.} = - result = n.kind == nkInfix and n[0].kind == nkIdent and - n[0].ident.id == ord(wDotDot) + if n.kind == nkInfix: + if n[0].kind == nkIdent and n[0].ident.id == ord(wDotDot) or + n[0].kind == nkSymChoice and n[0][1].sym.name.id == ord(wDotDot): + result = true |