summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-10-22 10:24:19 +0200
committerAraq <rumpf_a@web.de>2015-10-22 10:24:19 +0200
commit3f24a7ff3ea45253b496ab08c2bdecb838f0419d (patch)
tree8fe2f0d7a519f8d3f3e86ec6cf67791d72e18cdf
parent3d512a73e61b27fc5a6de24f281d7f42db784884 (diff)
downloadNim-3f24a7ff3ea45253b496ab08c2bdecb838f0419d.tar.gz
mitigates unclear nimsuggest problem
-rw-r--r--compiler/transf.nim1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/transf.nim b/compiler/transf.nim
index 92319ac19..3d78a6b92 100644
--- a/compiler/transf.nim
+++ b/compiler/transf.nim
@@ -304,6 +304,7 @@ proc transformYield(c: PTransf, n: PNode): PTransNode =
   var e = n.sons[0]
   # c.transCon.forStmt.len == 3 means that there is one for loop variable
   # and thus no tuple unpacking:
+  if e.typ.isNil: return result # can happen in nimsuggest for unknown reasons
   if skipTypes(e.typ, {tyGenericInst}).kind == tyTuple and
       c.transCon.forStmt.len != 3:
     e = skipConv(e)