Skip to content

Commit c1c2ea3

Browse files
authored
Merge pull request #4040 from mansellan/4039
Fixed caching issue for ComProject KnownTypes
2 parents 15fc993 + 0b0cf4e commit c1c2ea3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Rubberduck.Parsing/ComReflection/ComProject.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,18 +120,18 @@ private void LoadModules(ITypeLib typeLibrary)
120120
case TYPEKIND.TKIND_ENUM:
121121
var enumeration = type ?? new ComEnumeration(typeLibrary, info, typeAttributes, index);
122122
_enumerations.Add(enumeration as ComEnumeration);
123-
if (type != null) KnownTypes.TryAdd(typeAttributes.guid, enumeration);
123+
if (type == null) KnownTypes.TryAdd(typeAttributes.guid, enumeration);
124124
break;
125125
case TYPEKIND.TKIND_COCLASS:
126126
var coclass = type ?? new ComCoClass(typeLibrary, info, typeAttributes, index);
127127
_classes.Add(coclass as ComCoClass);
128-
if (type != null) KnownTypes.TryAdd(typeAttributes.guid, coclass);
128+
if (type == null) KnownTypes.TryAdd(typeAttributes.guid, coclass);
129129
break;
130130
case TYPEKIND.TKIND_DISPATCH:
131131
case TYPEKIND.TKIND_INTERFACE:
132132
var intface = type ?? new ComInterface(typeLibrary, info, typeAttributes, index);
133133
_interfaces.Add(intface as ComInterface);
134-
if (type != null) KnownTypes.TryAdd(typeAttributes.guid, intface);
134+
if (type == null) KnownTypes.TryAdd(typeAttributes.guid, intface);
135135
break;
136136
case TYPEKIND.TKIND_RECORD:
137137
var structure = new ComStruct(typeLibrary, info, typeAttributes, index);
@@ -140,7 +140,7 @@ private void LoadModules(ITypeLib typeLibrary)
140140
case TYPEKIND.TKIND_MODULE:
141141
var module = type ?? new ComModule(typeLibrary, info, typeAttributes, index);
142142
_modules.Add(module as ComModule);
143-
if (type != null) KnownTypes.TryAdd(typeAttributes.guid, module);
143+
if (type == null) KnownTypes.TryAdd(typeAttributes.guid, module);
144144
break;
145145
case TYPEKIND.TKIND_ALIAS:
146146
var alias = new ComAlias(typeLibrary, info, index, typeAttributes);

0 commit comments

Comments
 (0)