Don't try and index a variable we don't know the type of

This commit is contained in:
Deukhoofd 2019-01-14 14:30:56 +01:00
parent 11092c11ff
commit cd140603dd
No known key found for this signature in database
GPG Key ID: B4C087AC81641654
2 changed files with 4 additions and 2 deletions

View File

@ -322,6 +322,10 @@ 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)
{

View File

@ -1,8 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using Upsilon.BaseTypes;
using Upsilon.BaseTypes.UserData;
using Upsilon.Binder;