diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2016-07-19 19:27:38 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2016-07-19 19:27:38 +0200 |
commit | dc4b2c920c9659bcd5691cd1e88140df3dc06330 (patch) | |
tree | 1e73de90b6200d6aec3bfa49e62b4f3a83645971 /compiler/sigmatch.nim | |
parent | d455d58af6c511414f59eff2fffd64379dd4deac (diff) | |
download | Nim-dc4b2c920c9659bcd5691cd1e88140df3dc06330.tar.gz |
fixes #4328
Diffstat (limited to 'compiler/sigmatch.nim')
-rw-r--r-- | compiler/sigmatch.nim | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 4a5132d6d..22915a4bb 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -1777,7 +1777,10 @@ proc matches*(c: PContext, n, nOrig: PNode, m: var TCandidate) = break else: # use default value: - setSon(m.call, formal.position + 1, copyTree(formal.ast)) + var def = copyTree(formal.ast) + if def.kind == nkNilLit: + def = implicitConv(nkHiddenStdConv, formal.typ, def, m, c) + setSon(m.call, formal.position + 1, def) inc(f) proc argtypeMatches*(c: PContext, f, a: PType): bool = |