File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -902,6 +902,30 @@ End Sub
902
902
&& ! item . IsAssignment ) ) ;
903
903
}
904
904
905
+ [ TestMethod ]
906
+ public void SubscriptWrite_IsNotAssignmentReferenceToObjectDeclaration ( )
907
+ {
908
+ var code = @"
909
+ Public Sub DoSomething()
910
+ Dim foo As Object
911
+ Set foo = CreateObject(""Scripting.Dictionary"")
912
+ foo(""key"") = 42
913
+ End Sub
914
+ " ;
915
+ // act
916
+ var state = Resolve ( code ) ;
917
+
918
+ // assert
919
+ var declaration = state . AllUserDeclarations . Single ( item =>
920
+ item . DeclarationType == DeclarationType . Variable
921
+ && item . IdentifierName == "foo" ) ;
922
+
923
+ Assert . IsNotNull ( declaration . References . SingleOrDefault ( item =>
924
+ item . ParentScoping . DeclarationType == DeclarationType . Procedure
925
+ && item . ParentScoping . IdentifierName == "DoSomething"
926
+ && ! item . IsAssignment ) ) ;
927
+ }
928
+
905
929
[ TestMethod ]
906
930
public void ArraySubscriptWrite_IsAssignmentReferenceToArrayDeclaration ( )
907
931
{
You can’t perform that action at this time.
0 commit comments