diff options
author | LemonBoy <LemonBoy@users.noreply.github.com> | 2018-07-14 01:44:40 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-07-14 01:44:40 +0200 |
commit | 9b98add6c714474e261df1a0a17819282dfd1975 (patch) | |
tree | fd69fc408a01eb89b0e479fddb0771254dc75486 /compiler | |
parent | dd47013017d75a2b1a8c80e12f273e18e86f7d72 (diff) | |
download | Nim-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.nim | 5 |
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 |