From 0a8648ce8071cb09abe22ab63bffcbda6feed8e0 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Mon, 14 Jan 2019 14:40:16 +0100 Subject: [PATCH] Better handling of unknown indexing --- Upsilon/Binder/Binder.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Upsilon/Binder/Binder.cs b/Upsilon/Binder/Binder.cs index f3a80b9..3466041 100644 --- a/Upsilon/Binder/Binder.cs +++ b/Upsilon/Binder/Binder.cs @@ -322,10 +322,6 @@ namespace Upsilon.Binder { var fullStopIndexExpression = (BoundFullStopIndexExpression) expression; var indexerExpression = fullStopIndexExpression.Expression; - if (indexerExpression.Type == Type.Unknown) - { - return new VariableSymbol(fullStopIndexExpression.Index, Type.Unknown, true); - } var indexerVariable = ResolveVariable(indexerExpression, diagnostics); if (indexerVariable == null) { @@ -369,6 +365,10 @@ namespace Upsilon.Binder { return new VariableSymbol("", expression.Type, true); } + else if (expression.Type == Type.Unknown) + { + return new VariableSymbol("", Type.Unknown, true); + } return null; }