style improvements
This commit is contained in:
parent
746da12d74
commit
44d82d9492
2 changed files with 3 additions and 3 deletions
|
|
@ -77,7 +77,7 @@ proc checkTypes(c: PPatternContext, p: PSym, n: PNode): bool =
|
||||||
if isNil(n.typ):
|
if isNil(n.typ):
|
||||||
result = p.typ.kind in {tyVoid, tyStmt}
|
result = p.typ.kind in {tyVoid, tyStmt}
|
||||||
else:
|
else:
|
||||||
result = sigmatch.argtypeMatches(c.c, p.typ, n.typ, from_hlo = true)
|
result = sigmatch.argtypeMatches(c.c, p.typ, n.typ, fromHlo = true)
|
||||||
|
|
||||||
proc isPatternParam(c: PPatternContext, p: PNode): bool {.inline.} =
|
proc isPatternParam(c: PPatternContext, p: PNode): bool {.inline.} =
|
||||||
result = p.kind == nkSym and p.sym.kind == skParam and p.sym.owner == c.owner
|
result = p.kind == nkSym and p.sym.kind == skParam and p.sym.owner == c.owner
|
||||||
|
|
|
||||||
|
|
@ -2359,14 +2359,14 @@ proc matches*(c: PContext, n, nOrig: PNode, m: var TCandidate) =
|
||||||
for t in m.inferredTypes:
|
for t in m.inferredTypes:
|
||||||
if t.sonsLen > 1: t.sons.setLen 1
|
if t.sonsLen > 1: t.sons.setLen 1
|
||||||
|
|
||||||
proc argtypeMatches*(c: PContext, f, a: PType, from_hlo = false): bool =
|
proc argtypeMatches*(c: PContext, f, a: PType, fromHlo = false): bool =
|
||||||
var m: TCandidate
|
var m: TCandidate
|
||||||
initCandidate(c, m, f)
|
initCandidate(c, m, f)
|
||||||
let res = paramTypesMatch(m, f, a, ast.emptyNode, nil)
|
let res = paramTypesMatch(m, f, a, ast.emptyNode, nil)
|
||||||
#instantiateGenericConverters(c, res, m)
|
#instantiateGenericConverters(c, res, m)
|
||||||
# XXX this is used by patterns.nim too; I think it's better to not
|
# XXX this is used by patterns.nim too; I think it's better to not
|
||||||
# instantiate generic converters for that
|
# instantiate generic converters for that
|
||||||
if not from_hlo:
|
if not fromHlo:
|
||||||
res != nil
|
res != nil
|
||||||
else:
|
else:
|
||||||
# pattern templates do not allow for conversions except from int literal
|
# pattern templates do not allow for conversions except from int literal
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue