Skip to content

Commit b9001d2

Browse files
committed
Merge pull request #658 from rubberduck-vba/GrammarIsFun
Fixed With block resolution
2 parents a0ac05c + 6129ebf commit b9001d2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Rubberduck.Parsing/Symbols/IdentifierReferenceListener.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ public override void EnterWithStmt(VBAParser.WithStmtContext context)
173173
if (qualifier != null)
174174
{
175175
qualifier.AddReference(reference);
176+
_alreadyResolved.Add(reference.Context);
176177
}
177178
_withBlockQualifiers.Push(qualifier); // note: pushes null if unresolved
178179
}
@@ -601,7 +602,8 @@ public override void EnterICS_B_MemberProcedureCall(VBAParser.ICS_B_MemberProced
601602
if (_withBlockQualifiers.Any())
602603
{
603604
parentType = _withBlockQualifiers.Peek();
604-
parentScope = Resolve(context.implicitCallStmt_InStmt(), parentType, ContextAccessorType.GetValueOrReference);
605+
parentScope = Resolve(context.implicitCallStmt_InStmt(), parentType, ContextAccessorType.GetValueOrReference)
606+
?? Resolve(context.ambiguousIdentifier(), parentType);
605607
parentType = ResolveType(parentScope);
606608
}
607609
if (parentType == null)

0 commit comments

Comments
 (0)