Skip to content

Commit 818bfdc

Browse files
author
Arthur Ozga
committed
accessibility check
1 parent a1d2049 commit 818bfdc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/compiler/checker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2443,11 +2443,11 @@ namespace ts {
24432443
if (type.flags & TypeFlags.TypeParameter) {
24442444
const name = symbolToName(type.symbol, /*expectsIdentifier*/ false, context);
24452445
// Ignore constraint/default when creating a usage (as opposed to declaration) of a type parameter.
2446-
// TODO: add constraint here?
24472446
return createTypeReferenceNode(name, /*typeArguments*/ undefined);
24482447
}
24492448

2450-
if (!inTypeAlias && type.aliasSymbol) {
2449+
if (!inTypeAlias && type.aliasSymbol &&
2450+
isSymbolAccessible(type.aliasSymbol, context.enclosingDeclaration, SymbolFlags.Type, /*shouldComputeAliasesToMakeVisible*/ false).accessibility === SymbolAccessibility.Accessible) {
24512451
const name = symbolToName(type.aliasSymbol, /*expectsIdentifier*/ false, context);
24522452
const typeArgumentNodes = type.aliasTypeArguments && mapToTypeNodeArray(type.aliasTypeArguments, /*addInElementTypeFlag*/ false);
24532453
return createTypeReferenceNode(name, typeArgumentNodes);

0 commit comments

Comments
 (0)