From db0a4a9f86d167faccbd50f3f12f9de470e516b8 Mon Sep 17 00:00:00 2001 From: Araq Date: Tue, 21 Jun 2011 01:52:42 +0200 Subject: bugfix: shallowCopy should not break bootstrapping anymore; encodings.nim for windows improved --- compiler/semexprs.nim | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'compiler') diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 67ad158f4..3841ae9fb 100755 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -850,11 +850,15 @@ proc semMagic(c: PContext, n: PNode, s: PSym, flags: TExprFlags): PNode = if semthreads.needsGlobalAnalysis(): c.threadEntries.add(result) of mShallowCopy: - checkSonsLen(n, 3) - result = newNodeI(nkFastAsgn, n.info) - result.add(n[1]) - result.add(n[2]) - result = semAsgn(c, result) + if sonsLen(n) == 3: + # XXX ugh this is really a hack: shallowCopy() can be overloaded only + # with procs that take not 2 parameters: + result = newNodeI(nkFastAsgn, n.info) + result.add(n[1]) + result.add(n[2]) + result = semAsgn(c, result) + else: + result = semDirectOp(c, n, flags) else: result = semDirectOp(c, n, flags) proc semIfExpr(c: PContext, n: PNode): PNode = -- cgit 1.4.1-2-gfad0