diff options
Diffstat (limited to 'compiler/semexprs.nim')
-rw-r--r-- | compiler/semexprs.nim | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 504a54813..0cf601251 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -1540,7 +1540,7 @@ proc semAsgn(c: PContext, n: PNode; mode=asgnNormal): PNode = 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 + elif (skipTypes(le, {tyGenericInst, tyAlias, tySink}).kind != tyVar and isAssignable(c, a) == arNone) or skipTypes(le, abstractVar).kind in {tyOpenArray, tyVarargs}: # Direct assignment to a discriminant is allowed! |