From bb7a14fec0fe3b88cddb51ae9550c2b6a4d75099 Mon Sep 17 00:00:00 2001 From: Araq Date: Sun, 27 May 2012 16:22:48 +0200 Subject: [PATCH] bugfix: UFCS for templates (ttempl3.nim enhanced) --- compiler/lookups.nim | 21 +++++++++++---------- tests/compile/ttempl3.nim | 15 +++++++++++++++ todo.txt | 1 + 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/compiler/lookups.nim b/compiler/lookups.nim index 62f4a3391..d9725eedf 100755 --- a/compiler/lookups.nim +++ b/compiler/lookups.nim @@ -21,18 +21,19 @@ proc considerAcc*(n: PNode): PIdent = case n.len of 0: GlobalError(n.info, errIdentifierExpected, renderTree(n)) of 1: result = considerAcc(n.sons[0]) - of 2: - if n[0].ident.id == ord(wStar): + else: + if n.len == 2 and n[0].kind == nkIdent and n[0].ident.id == ord(wStar): + # XXX find a better way instead of `*x` for 'genSym' result = genSym(n[1].ident.s) else: - result = getIdent(n[0].ident.s & n[1].ident.s) - else: - var id = "" - for i in 0..