fix #8335
This commit is contained in:
parent
cba86a9893
commit
a147166710
1 changed files with 2 additions and 0 deletions
|
|
@ -1538,6 +1538,8 @@ proc semAsgn(c: PContext, n: PNode; mode=asgnNormal): PNode =
|
||||||
# a = b # both are vars, means: a[] = b[]
|
# a = b # both are vars, means: a[] = b[]
|
||||||
# a = b # b no 'var T' means: a = addr(b)
|
# a = b # b no 'var T' means: a = addr(b)
|
||||||
var le = a.typ
|
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
|
if (skipTypes(le, {tyGenericInst, tyAlias, tySink}).kind != tyVar and
|
||||||
isAssignable(c, a) == arNone) or
|
isAssignable(c, a) == arNone) or
|
||||||
skipTypes(le, abstractVar).kind in {tyOpenArray, tyVarargs}:
|
skipTypes(le, abstractVar).kind in {tyOpenArray, tyVarargs}:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue