diff options
author | Araq <rumpf_a@web.de> | 2014-11-17 08:28:24 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-11-17 08:28:24 +0100 |
commit | 729e048a324a6908b6a2d19a7d0186c05880151c (patch) | |
tree | b7fe3838dd03c2f614e921828f7cf627ba7ff7e4 /compiler | |
parent | fd532b6dab930db7f456700f791065f22c155f9c (diff) | |
download | Nim-729e048a324a6908b6a2d19a7d0186c05880151c.tar.gz |
fixes #940
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/renderer.nim | 11 | ||||
-rw-r--r-- | compiler/semgnrc.nim | 2 | ||||
-rw-r--r-- | compiler/semtempl.nim | 3 | ||||
-rw-r--r-- | compiler/sigmatch.nim | 2 |
4 files changed, 13 insertions, 5 deletions
diff --git a/compiler/renderer.nim b/compiler/renderer.nim index a4469acda..b0d328f9e 100644 --- a/compiler/renderer.nim +++ b/compiler/renderer.nim @@ -894,8 +894,15 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) = put(g, tkParLe, "(") for i in countup(0, sonsLen(n) - 1): if i > 0: put(g, tkOpr, "|") - gsub(g, n.sons[i], c) - put(g, tkParRi, ")") + if n.sons[i].kind == nkSym: + let s = n[i].sym + if s.owner != nil: + put g, tkSymbol, n[i].sym.owner.name.s + put g, tkOpr, "." + put g, tkSymbol, n[i].sym.name.s + else: + gsub(g, n.sons[i], c) + put(g, tkParRi, if n.kind == nkOpenSymChoice: "|...)" else: ")") of nkPar, nkClosure: put(g, tkParLe, "(") gcomma(g, n, c) diff --git a/compiler/semgnrc.nim b/compiler/semgnrc.nim index 6c218fa0c..07e7a5136 100644 --- a/compiler/semgnrc.nim +++ b/compiler/semgnrc.nim @@ -166,7 +166,7 @@ proc semGenericStmt(c: PContext, n: PNode, var first = 0 var isDefinedMagic = false - if s != nil: + if s != nil: incl(s.flags, sfUsed) isDefinedMagic = s.magic in {mDefined, mDefinedInScope, mCompiles} let scOption = if s.name.id in ctx: scForceOpen else: scOpen diff --git a/compiler/semtempl.nim b/compiler/semtempl.nim index 0a647a65d..38b0536db 100644 --- a/compiler/semtempl.nim +++ b/compiler/semtempl.nim @@ -63,7 +63,8 @@ proc symChoice(c: PContext, n: PNode, s: PSym, r: TSymChoiceRule): PNode = else: # semantic checking requires a type; ``fitNode`` deals with it # appropriately - let kind = if r == scClosed: nkClosedSymChoice else: nkOpenSymChoice + let kind = if r == scClosed or n.kind == nkDotExpr: nkClosedSymChoice + else: nkOpenSymChoice result = newNodeIT(kind, n.info, newTypeS(tyNone, c)) a = initOverloadIter(o, c, n) while a != nil: diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 4a3773ed8..e44cd7049 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -23,7 +23,7 @@ type csEmpty, csMatch, csNoMatch CandidateErrors* = seq[PSym] - TCandidate* {.final.} = object + TCandidate* = object c*: PContext exactMatches*: int # also misused to prefer iters over procs genericMatches: int # also misused to prefer constraints |