@@ -157,8 +157,7 @@ namespace Nitra.BackEnd.Cci
157157 def nestedTypes = LightList();
158158 foreach (cciNestedType in type .NestedTypes)
159159 {
160- def visibility = cciNestedType.Visibility;
161- when (visibility != TypeMemberVisibility.Private && visibility != TypeMemberVisibility.Assembly)
160+ when (TypeHelper.IsVisibleOutsideAssembly(cciNestedType))
162161 nestedTypes.Add(loadNestedType(cciNestedType, genericContainerTypeSymbol));
163162 }
164163
@@ -494,7 +493,12 @@ namespace Nitra.BackEnd.Cci
494493 }
495494
496495 | t is IGenericTypeInstanceReference =>
497- _cciInternedKeyToGenericSymbolMap.GetOrAdd(cciTypeReference.InternedKey, _key => {
496+ mutable typeSymbol;
497+
498+ if (_cciInternedKeyToGenericSymbolMap.TryGetValue(cciTypeReference.InternedKey, out typeSymbol))
499+ typeSymbol
500+ else
501+ {
498502 def typeInfo = CciTypeToTypeSymbol(t.GenericType, context) :> GenericTypeSymbol;
499503 def args = t.GenericArguments.Select(CciTypeToTypeSymbol(_ , context)).ToImmutableArray();
500504 def name = Name(NoLocation, t.GenericType.Name.Value);
@@ -503,8 +507,11 @@ namespace Nitra.BackEnd.Cci
503507 constructedType.TypeInfo = typeInfo;
504508 constructedType.Args = args;
505509 constructedType.EvalProperties(context);
510+ def ok = _cciInternedKeyToGenericSymbolMap.TryAdd(cciTypeReference.InternedKey, constructedType);
511+ assert2(ok);
506512 constructedType
507- });
513+ }
514+
508515 | _ =>
509516 // resolvs++;
510517 mutable typeSymbol;
@@ -602,7 +609,7 @@ namespace Nitra.BackEnd.Cci
602609 def typeSymbol = CciTypeToTypeSymbol(cciBaseClasse, context);
603610 baseTypeSet.AddParent(typeSymbol);
604611 }
605- foreach (cciInterface in cciType.Interfaces)
612+ foreach (cciInterface when TypeHelper.IsVisibleOutsideAssembly(cciInterface.ResolvedType) in cciType.Interfaces)
606613 {
607614 def typeSymbol = CciTypeToTypeSymbol(cciInterface, context);
608615 baseTypeSet.AddParent(typeSymbol);
0 commit comments