// This shouldn't be necessary, but CCI is putting a nonzero TypeDefId in the ExportedTypes table // for nested types if NamespaceAliasForType.AliasedType is set to an ITypeDefinition // so we make an ITypeReference copy as a workaround. private static INamedTypeReference ConvertDefinitionToReferenceIfTypeIsNested(INamedTypeDefinition typeDef, IMetadataHost host) { var nestedTypeDef = typeDef as INestedTypeDefinition; if (nestedTypeDef == null) { return(typeDef); } var typeRef = new NestedTypeReference(); typeRef.Copy(nestedTypeDef, host.InternFactory); return(typeRef); }
// This shouldn't be necessary, but CCI is putting a nonzero TypeDefId in the ExportedTypes table // for nested types if NamespaceAliasForType.AliasedType is set to an ITypeDefinition // so we make an ITypeReference copy as a workaround. private static INamedTypeReference ConvertDefinitionToReferenceIfTypeIsNested(INamedTypeDefinition typeDef, IMetadataHost host) { var nestedTypeDef = typeDef as INestedTypeDefinition; if (nestedTypeDef == null) return typeDef; var typeRef = new NestedTypeReference(); typeRef.Copy(nestedTypeDef, host.InternFactory); return typeRef; }