summary refs log tree commit diff stats
path: root/compiler/sigmatch.nim
diff options
context:
space:
mode:
authormetagn <metagngn@gmail.com>2024-01-24 00:00:34 +0300
committerGitHub <noreply@github.com>2024-01-23 22:00:34 +0100
commitee984f8836740cb64d88c622ff652e396751edee (patch)
tree1a62e0aba3eda4a92d3af19402a987a3029b284f /compiler/sigmatch.nim
parentbe0b8472130112ad570a6720a0e3a34e67936619 (diff)
downloadNim-ee984f8836740cb64d88c622ff652e396751edee.tar.gz
account for nil return type in tyProc sumGeneric (#23250)
fixes #23249
Diffstat (limited to 'compiler/sigmatch.nim')
-rw-r--r--compiler/sigmatch.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim
index b4d875981..a0de33ed5 100644
--- a/compiler/sigmatch.nim
+++ b/compiler/sigmatch.nim
@@ -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