Don't try and index a variable we don't know the type of
This commit is contained in:
parent
11092c11ff
commit
cd140603dd
|
@ -322,6 +322,10 @@ namespace Upsilon.Binder
|
||||||
{
|
{
|
||||||
var fullStopIndexExpression = (BoundFullStopIndexExpression) expression;
|
var fullStopIndexExpression = (BoundFullStopIndexExpression) expression;
|
||||||
var indexerExpression = fullStopIndexExpression.Expression;
|
var indexerExpression = fullStopIndexExpression.Expression;
|
||||||
|
if (indexerExpression.Type == Type.Unknown)
|
||||||
|
{
|
||||||
|
return new VariableSymbol(fullStopIndexExpression.Index, Type.Unknown, true);
|
||||||
|
}
|
||||||
var indexerVariable = ResolveVariable(indexerExpression, diagnostics);
|
var indexerVariable = ResolveVariable(indexerExpression, diagnostics);
|
||||||
if (indexerVariable == null)
|
if (indexerVariable == null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
|
||||||
using Upsilon.BaseTypes;
|
using Upsilon.BaseTypes;
|
||||||
using Upsilon.BaseTypes.UserData;
|
using Upsilon.BaseTypes.UserData;
|
||||||
using Upsilon.Binder;
|
using Upsilon.Binder;
|
||||||
|
|
Loading…
Reference in New Issue