mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-18 13:30:33 +00:00
fixes another regression
This commit is contained in:
@@ -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
|
||||
|
||||
17
tests/generics/tspecialized_procvar.nim
Normal file
17
tests/generics/tspecialized_procvar.nim
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user