diff options
author | Zahary Karadjov <zahary@gmail.com> | 2014-03-16 17:12:30 +0200 |
---|---|---|
committer | Zahary Karadjov <zahary@gmail.com> | 2014-03-16 20:42:06 +0200 |
commit | f0953db3ba59f2e23df2fb7932c672f5020db5fb (patch) | |
tree | 4d19cedca26380083c6374f8a97f3b0c0eba8892 /compiler/sigmatch.nim | |
parent | da5d88f04ef8adb7e2606fb16c6cbde770d39fe0 (diff) | |
download | Nim-f0953db3ba59f2e23df2fb7932c672f5020db5fb.tar.gz |
handle arbitrary expressions dependent on static input params in proc signatures
Diffstat (limited to 'compiler/sigmatch.nim')
-rw-r--r-- | compiler/sigmatch.nim | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 4ad7849e5..b87d27cb4 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -1053,11 +1053,15 @@ proc paramTypesMatchAux(m: var TCandidate, f, argType: PType, # and finally start using tyTypedesc for generic types properly. if argType.kind == tyGenericParam and tfWildcard in argType.flags: argType.assignType(f) - argType.flags.incl tfUnresolved # put(m.bindings, f, argType) return argSemantized - if argType.kind != tyStatic: + if argType.kind == tyStatic: + if m.calleeSym.kind == skType: + result = newNodeI(nkType, argOrig.info) + result.typ = makeTypeFromExpr(c, arg) + return + else: var evaluated = c.semTryConstExpr(c, arg) if evaluated != nil: arg.typ = newTypeS(tyStatic, c) |