Better handling of unknown indexing

This commit is contained in:
2019-01-14 14:40:16 +01:00
parent cd140603dd
commit 0a8648ce80

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