@@ -22,13 +22,22 @@ public static IEnumerable<Declaration> GetDeclarationsPotentiallyRequiringSetAss
22
22
public static bool RequiresSetAssignment ( IdentifierReference reference , RubberduckParserState state )
23
23
{
24
24
//Not an assignment...definitely does not require a 'Set' assignment
25
- if ( ! reference . IsAssignment ) { return false ; }
25
+ if ( ! reference . IsAssignment )
26
+ {
27
+ return false ;
28
+ }
26
29
27
30
//We know for sure it DOES NOT use 'Set'
28
- if ( ! MayRequireAssignmentUsingSet ( reference . Declaration ) ) { return false ; }
31
+ if ( ! MayRequireAssignmentUsingSet ( reference . Declaration ) )
32
+ {
33
+ return false ;
34
+ }
29
35
30
36
//We know for sure that it DOES use 'Set'
31
- if ( RequiresAssignmentUsingSet ( reference . Declaration ) ) { return true ; }
37
+ if ( RequiresAssignmentUsingSet ( reference . Declaration ) )
38
+ {
39
+ return true ;
40
+ }
32
41
33
42
//We need to look everything to understand the RHS - the assigned reference is probably a Variant
34
43
var allInterestingDeclarations = GetDeclarationsPotentiallyRequiringSetAssignment ( state . AllUserDeclarations ) ;
@@ -38,11 +47,20 @@ public static bool RequiresSetAssignment(IdentifierReference reference, Rubberdu
38
47
39
48
private static bool MayRequireAssignmentUsingSet ( Declaration declaration )
40
49
{
41
- if ( declaration . DeclarationType == DeclarationType . PropertyLet ) { return false ; }
50
+ if ( declaration . DeclarationType == DeclarationType . PropertyLet )
51
+ {
52
+ return false ;
53
+ }
42
54
43
- if ( declaration . AsTypeName == Tokens . Variant ) { return true ; }
55
+ if ( declaration . AsTypeName == Tokens . Variant )
56
+ {
57
+ return true ;
58
+ }
44
59
45
- if ( declaration . IsArray ) { return false ; }
60
+ if ( declaration . IsArray )
61
+ {
62
+ return false ;
63
+ }
46
64
47
65
if ( declaration . AsTypeDeclaration != null )
48
66
{
0 commit comments