From 170573a87f0df749bdb91126c930826ba5329e95 Mon Sep 17 00:00:00 2001 From: Araq Date: Wed, 29 Jun 2011 19:14:35 +0200 Subject: [PATCH] bugfix: subranges in generics properly detected --- compiler/trees.nim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/compiler/trees.nim b/compiler/trees.nim index 3c8775b876..76a30e3ac2 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