account for nil return type in tyProc sumGeneric (#23250)

fixes #23249
This commit is contained in:
metagn
2024-01-24 00:00:34 +03:00
committed by GitHub
parent be0b847213
commit ee984f8836
2 changed files with 19 additions and 1 deletions

View File

@@ -246,7 +246,8 @@ proc sumGeneric(t: PType): int =
result += sumGeneric(a)
break
of tyProc:
result += sumGeneric(t.returnType)
if t.returnType != nil:
result += sumGeneric(t.returnType)
for _, a in t.paramTypes:
result += sumGeneric(a)
break