diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2016-01-13 11:36:34 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2016-01-13 11:36:34 +0100 |
commit | 6fbde1f4fbadd6c2b1eb472324b76116eb8cbd8e (patch) | |
tree | 68166171e50b1c42abf0fc19ec020a6db90a7468 | |
parent | d0709cc758ae9668dc04e6699604cff0870ed053 (diff) | |
download | Nim-6fbde1f4fbadd6c2b1eb472324b76116eb8cbd8e.tar.gz |
fixes another regression
-rw-r--r-- | compiler/sigmatch.nim | 4 | ||||
-rw-r--r-- | tests/generics/tspecialized_procvar.nim | 17 |
2 files changed, 19 insertions, 2 deletions
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 784294839..354cf965e 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -167,12 +167,12 @@ proc sumGeneric(t: PType): int = t = t.lastSon if t.kind == tyEmpty: break inc result - of tyGenericInvocation, tyTuple: + of tyGenericInvocation, tyTuple, tyProc: result += ord(t.kind == tyGenericInvocation) for i in 0 .. <t.len: result += t.sons[i].sumGeneric break of tyGenericParam, tyExpr, tyStatic, tyStmt: break - of tyBool, tyChar, tyEnum, tyObject, tyProc, tyPointer, + of tyBool, tyChar, tyEnum, tyObject, tyPointer, tyString, tyCString, tyInt..tyInt64, tyFloat..tyFloat128, tyUInt..tyUInt64: return isvar diff --git a/tests/generics/tspecialized_procvar.nim b/tests/generics/tspecialized_procvar.nim new file mode 100644 index 000000000..4bdc94a66 --- /dev/null +++ b/tests/generics/tspecialized_procvar.nim @@ -0,0 +1,17 @@ +discard """ + output: '''concrete 88''' +""" + +# Another regression triggered by changed closure computations: + +proc foo[T](x: proc(): T) = + echo "generic ", x() + +proc foo(x: proc(): int) = + echo "concrete ", x() + +# note the following 'proc' is not .closure! +foo(proc (): auto {.nimcall.} = 88) + +# bug #3499 last snippet fixed +# bug 705 last snippet fixed |