diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 10ae49b12d..504a548134 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -1538,6 +1538,8 @@ proc semAsgn(c: PContext, n: PNode; mode=asgnNormal): PNode = # a = b # both are vars, means: a[] = b[] # a = b # b no 'var T' means: a = addr(b) var le = a.typ + if le == nil: + localError(c.config, a.info, "expression has no type") if (skipTypes(le, {tyGenericInst, tyAlias, tySink}).kind != tyVar and isAssignable(c, a) == arNone) or skipTypes(le, abstractVar).kind in {tyOpenArray, tyVarargs}: