@@ -10,6 +10,7 @@ public sealed class ClassModuleDeclaration : Declaration
10
10
{
11
11
private readonly bool _isExposed ;
12
12
private readonly bool _isGlobalClassModule ;
13
+ private readonly bool _hasDefaultInstanceVariable ;
13
14
private readonly List < string > _supertypeNames ;
14
15
private readonly HashSet < Declaration > _supertypes ;
15
16
private readonly HashSet < Declaration > _subtypes ;
@@ -22,7 +23,8 @@ public ClassModuleDeclaration(
22
23
IEnumerable < IAnnotation > annotations ,
23
24
Attributes attributes ,
24
25
bool isExposed = false ,
25
- bool isGlobalClassModule = false )
26
+ bool isGlobalClassModule = false ,
27
+ bool hasDefaultInstanceVariable = false )
26
28
: base (
27
29
qualifiedName ,
28
30
projectDeclaration ,
@@ -43,6 +45,7 @@ public ClassModuleDeclaration(
43
45
{
44
46
_isExposed = isExposed ;
45
47
_isGlobalClassModule = isGlobalClassModule ;
48
+ _hasDefaultInstanceVariable = hasDefaultInstanceVariable ;
46
49
_supertypeNames = new List < string > ( ) ;
47
50
_supertypes = new HashSet < Declaration > ( ) ;
48
51
_subtypes = new HashSet < Declaration > ( ) ;
@@ -97,12 +100,13 @@ public bool HasPredeclaredId
97
100
{
98
101
get
99
102
{
103
+ bool attributeHasDefaultInstanceVariable = false ;
100
104
IEnumerable < string > value ;
101
105
if ( Attributes . TryGetValue ( "VB_PredeclaredId" , out value ) )
102
106
{
103
- return value . Single ( ) == "True" ;
107
+ attributeHasDefaultInstanceVariable = value . Single ( ) == "True" ;
104
108
}
105
- return false ;
109
+ return _hasDefaultInstanceVariable || attributeHasDefaultInstanceVariable ;
106
110
}
107
111
}
108
112
0 commit comments