Better handling of unknown indexing

This commit is contained in:
Deukhoofd 2019-01-14 14:40:16 +01:00
parent cd140603dd
commit 0a8648ce80
No known key found for this signature in database
GPG Key ID: B4C087AC81641654
1 changed files with 4 additions and 4 deletions

View File

@ -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;
}