accessibility check
This commit is contained in:
parent
a1d2049c29
commit
818bfdcd88
1 changed files with 2 additions and 2 deletions
|
@ -2443,11 +2443,11 @@ namespace ts {
|
|||
if (type.flags & TypeFlags.TypeParameter) {
|
||||
const name = symbolToName(type.symbol, /*expectsIdentifier*/ false, context);
|
||||
// Ignore constraint/default when creating a usage (as opposed to declaration) of a type parameter.
|
||||
// TODO: add constraint here?
|
||||
return createTypeReferenceNode(name, /*typeArguments*/ undefined);
|
||||
}
|
||||
|
||||
if (!inTypeAlias && type.aliasSymbol) {
|
||||
if (!inTypeAlias && type.aliasSymbol &&
|
||||
isSymbolAccessible(type.aliasSymbol, context.enclosingDeclaration, SymbolFlags.Type, /*shouldComputeAliasesToMakeVisible*/ false).accessibility === SymbolAccessibility.Accessible) {
|
||||
const name = symbolToName(type.aliasSymbol, /*expectsIdentifier*/ false, context);
|
||||
const typeArgumentNodes = type.aliasTypeArguments && mapToTypeNodeArray(type.aliasTypeArguments, /*addInElementTypeFlag*/ false);
|
||||
return createTypeReferenceNode(name, typeArgumentNodes);
|
||||
|
|
Loading…
Reference in a new issue