summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorLemonBoy <LemonBoy@users.noreply.github.com>2018-07-14 01:44:40 +0200
committerAndreas Rumpf <rumpf_a@web.de>2018-07-14 01:44:40 +0200
commit9b98add6c714474e261df1a0a17819282dfd1975 (patch)
treefd69fc408a01eb89b0e479fddb0771254dc75486 /compiler
parentdd47013017d75a2b1a8c80e12f273e18e86f7d72 (diff)
downloadNim-9b98add6c714474e261df1a0a17819282dfd1975.tar.gz
Do not crash while instantiating a generic outside a call (#8279)
Fixes #8270
Diffstat (limited to 'compiler')
-rw-r--r--compiler/sigmatch.nim5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim
index 4bac3d3ea..7e9143d94 100644
--- a/compiler/sigmatch.nim
+++ b/compiler/sigmatch.nim
@@ -569,7 +569,10 @@ proc procParamTypeRel(c: var TCandidate, f, a: PType): TTypeRelation =
       # signature. There is a change that the target
       # type is already fully-determined, so we are
       # going to try resolve it
-      f = generateTypeInstance(c.c, c.bindings, c.call.info, f)
+      if c.call != nil:
+        f = generateTypeInstance(c.c, c.bindings, c.call.info, f)
+      else:
+        f = nil
       if f == nil or f.isMetaType:
         # no luck resolving the type, so the inference fails
         return isBothMetaConvertible