Fixes type changing when initially nil

This commit is contained in:
2018-11-14 17:10:06 +01:00
parent d6057ae954
commit 58b5a7355e

View File

@@ -156,7 +156,7 @@ namespace Upsilon.Binder
else
{
// don't allow assigning different typed variables to a variable, unless either of them is nil, allow assigning nil to all variables
if (boundExpression.Type != variable.Type && (variable.Type != Type.Nil || boundExpression.Type == Type.Nil))
if (boundExpression.Type != variable.Type)
{
if (variable.Type == Type.Nil || boundExpression.Type == Type.Nil)
{