diff options
author | Araq <rumpf_a@web.de> | 2011-03-25 00:47:03 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2011-03-25 00:47:03 +0100 |
commit | 032599c156260a0892522b6ce858b1cdff08df84 (patch) | |
tree | 582c86f5e7a23595e1253af47133be3c4764da1f /rod/sigmatch.nim | |
parent | 220dd54acfd5527c7c569811013b178fc462898e (diff) | |
download | Nim-032599c156260a0892522b6ce858b1cdff08df84.tar.gz |
bugfix: type converter that converts to bool in 'if' context
Diffstat (limited to 'rod/sigmatch.nim')
-rwxr-xr-x | rod/sigmatch.nim | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/rod/sigmatch.nim b/rod/sigmatch.nim index 2192c168a..8144cff0b 100755 --- a/rod/sigmatch.nim +++ b/rod/sigmatch.nim @@ -461,6 +461,7 @@ proc userConvMatch(c: PContext, m: var TCandidate, f, a: PType, var dest = c.converters[i].typ.sons[0] if (typeRel(m.bindings, f, dest) == isEqual) and (typeRel(m.bindings, src, a) == isEqual): + markUsed(arg, c.converters[i]) var s = newSymNode(c.converters[i]) s.typ = c.converters[i].typ s.info = arg.info @@ -564,6 +565,11 @@ proc IndexTypesMatch*(c: PContext, f, a: PType, arg: PNode): PNode = initCandidate(m, f) result = paramTypesMatch(c, m, f, a, arg) +proc ConvertTo*(c: PContext, f: PType, n: PNode): PNode = + var m: TCandidate + initCandidate(m, f) + result = paramTypesMatch(c, m, f, n.typ, n) + proc argtypeMatches*(c: PContext, f, a: PType): bool = var m: TCandidate initCandidate(m, f) |