Skip to content

Commit db79817

Browse files
committed
2 parents 0b37181 + 45c9c72 commit db79817

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Rubberduck.Parsing/Binding/SimpleNameDefaultBinding.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,14 @@ public IBoundExpression Resolve()
7575
var bracketedExpression = _declarationFinder.OnBracketedExpression(_context.GetText(), _context);
7676
return new SimpleNameExpression(bracketedExpression, ExpressionClassification.Unbound, _context);
7777
}
78-
else
78+
//TODO - this is a complete and total hack to prevent `Mid` and `Mid$` from creating undeclared variables
79+
//pending an actual fix to the grammar. See #2618
80+
else if (!_name.Equals("Mid") && !_name.Equals("Mid$"))
7981
{
8082
var undeclaredLocal = _declarationFinder.OnUndeclaredVariable(_parent, _name, _context);
8183
return new SimpleNameExpression(undeclaredLocal, ExpressionClassification.Variable, _context);
8284
}
83-
//return new ResolutionFailedExpression();
85+
return new ResolutionFailedExpression();
8486
}
8587

8688
private IBoundExpression ResolveProcedureNamespace()

0 commit comments

Comments
 (0)