diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 5a044d7dadd..1c67c2a7001 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1001,9 +1001,10 @@ module ts { var symbol = resolveName(enclosingDeclaration, (firstIdentifier).text, meaning, /*nodeNotFoundErrorMessage*/ undefined, /*nameArg*/ undefined); // Verify if the symbol is accessible - return hasVisibleDeclarations(symbol) || { + return hasVisibleDeclarations(symbol) || { accessibility: SymbolAccessibility.NotAccessible, errorSymbolName: getTextOfNode(firstIdentifier), + errorNode: firstIdentifier }; } diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 8dbf05d2587..83c0645d4f9 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -2562,7 +2562,7 @@ module ts { setWriter(oldWriter); } - function handleSymbolAccessibilityError(symbolAccesibilityResult: SymbolAccessiblityResult, errorNode?: Node) { + function handleSymbolAccessibilityError(symbolAccesibilityResult: SymbolAccessiblityResult) { if (symbolAccesibilityResult.accessibility === SymbolAccessibility.Accessible) { // write the aliases if (symbolAccesibilityResult && symbolAccesibilityResult.aliasesToMakeVisible) { @@ -2575,14 +2575,14 @@ module ts { var errorInfo = writer.getSymbolAccessibilityDiagnostic(symbolAccesibilityResult); if (errorInfo) { if (errorInfo.typeName) { - diagnostics.push(createDiagnosticForNode(errorNode || errorInfo.errorNode, + diagnostics.push(createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, getSourceTextOfLocalNode(errorInfo.typeName), symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); } else { - diagnostics.push(createDiagnosticForNode(errorNode || errorInfo.errorNode, + diagnostics.push(createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); @@ -2690,7 +2690,7 @@ module ts { // Aliases can be written asynchronously so use correct enclosing declaration entityName.parent.kind === SyntaxKind.ImportDeclaration ? entityName.parent : enclosingDeclaration); - handleSymbolAccessibilityError(visibilityResult, entityName); + handleSymbolAccessibilityError(visibilityResult); writeEntityName(entityName); function writeEntityName(entityName: EntityName) { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 1ef50051ec3..13e575760d7 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -792,10 +792,11 @@ module ts { export interface SymbolVisibilityResult { accessibility: SymbolAccessibility; aliasesToMakeVisible?: ImportDeclaration[]; // aliases that need to have this symbol visible + errorSymbolName?: string; // Optional symbol name that results in error + errorNode?: Node; // optional node that results in error } export interface SymbolAccessiblityResult extends SymbolVisibilityResult { - errorSymbolName?: string // Optional symbol name that results in error errorModuleName?: string // If the symbol is not visible from module, module's name } diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorAccessors.errors.txt b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorAccessors.errors.txt index 4338d852a12..b6130864d8b 100644 --- a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorAccessors.errors.txt +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorAccessors.errors.txt @@ -93,7 +93,7 @@ tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts(93,23): e // getter with annotation get foo111(): m2.public2 { - ~~~~~~~~~~ + ~~ !!! error TS4043: Return type of public property getter from exported class has or is using private name 'm2'. return; } @@ -107,7 +107,7 @@ tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts(93,23): e // setter with annotation set foo113(param: m2.public2) { - ~~~~~~~~~~ + ~~ !!! error TS4037: Parameter 'foo113' of public property setter from exported class has or is using private name 'm2'. } @@ -116,13 +116,13 @@ tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts(93,23): e return new m2.public2(); } set foo114(param: m2.public2) { - ~~~~~~~~~~ + ~~ !!! error TS4037: Parameter 'foo114' of public property setter from exported class has or is using private name 'm2'. } // Both - with annotation get foo115(): m2.public2 { - ~~~~~~~~~~ + ~~ !!! error TS4043: Return type of public property getter from exported class has or is using private name 'm2'. return; } diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorParameterOfFunction.errors.txt b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorParameterOfFunction.errors.txt index 7b2dc1ac911..7dbe3617de9 100644 --- a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorParameterOfFunction.errors.txt +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorParameterOfFunction.errors.txt @@ -49,7 +49,7 @@ tests/cases/compiler/declFileTypeAnnotationVisibilityErrorParameterOfFunction.ts } export function foo113(param: m2.public2) { - ~~~~~~~~~~ + ~~ !!! error TS4078: Parameter 'param' of exported function has or is using private name 'm2'. } export function foo114(param = new m2.public2()) { diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.errors.txt b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.errors.txt index 3aa451248fa..449af75bf61 100644 --- a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.errors.txt +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.errors.txt @@ -59,7 +59,7 @@ tests/cases/compiler/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.t } export function foo113(): m2.public2 { - ~~~~~~~~~~ + ~~ !!! error TS4060: Return type of exported function has or is using private name 'm2'. return; } diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.errors.txt b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.errors.txt index 644528b7288..a9fd72ae569 100644 --- a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.errors.txt +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.errors.txt @@ -50,7 +50,7 @@ tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeAlias.ts(39,24): e type t111 = m3.public1; export type t112 = m3.public1; // error - ~~~~~~~~~~ + ~~ !!! error TS4081: Exported type alias 't112' has or is using private name 'm3'. } \ No newline at end of file diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeLiteral.errors.txt b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeLiteral.errors.txt index ef811a919cb..8cba0d12464 100644 --- a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeLiteral.errors.txt +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeLiteral.errors.txt @@ -33,10 +33,10 @@ tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(33,16): ~~~~~~~~ !!! error TS4025: Exported variable 'x' has or is using private name 'private1'. y: m2.public1; - ~~~~~~~~~~ + ~~ !!! error TS4025: Exported variable 'x' has or is using private name 'm2'. (): m2.public1[]; - ~~~~~~~~~~ + ~~ !!! error TS4025: Exported variable 'x' has or is using private name 'm2'. method(): private1; ~~~~~~~~ @@ -45,7 +45,7 @@ tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(33,16): ~~~~~~~~ !!! error TS4025: Exported variable 'x' has or is using private name 'private1'. [s: string]: m2.public1; - ~~~~~~~~~~ + ~~ !!! error TS4025: Exported variable 'x' has or is using private name 'm2'. }; export var x2 = { @@ -69,7 +69,7 @@ tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(33,16): export var y: (a: private1) => m2.public1; ~~~~~~~~ !!! error TS4025: Exported variable 'y' has or is using private name 'private1'. - ~~~~~~~~~~ + ~~ !!! error TS4025: Exported variable 'y' has or is using private name 'm2'. export var y2 = y; ~~ @@ -81,7 +81,7 @@ tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(33,16): export var z: new (a: private1) => m2.public1; ~~~~~~~~ !!! error TS4025: Exported variable 'z' has or is using private name 'private1'. - ~~~~~~~~~~ + ~~ !!! error TS4025: Exported variable 'z' has or is using private name 'm2'. export var z2 = z; ~~ diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorVariableDeclaration.errors.txt b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorVariableDeclaration.errors.txt index d920cca51b2..33771b85dd4 100644 --- a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorVariableDeclaration.errors.txt +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorVariableDeclaration.errors.txt @@ -39,7 +39,7 @@ tests/cases/compiler/declFileTypeAnnotationVisibilityErrorVariableDeclaration.ts var y3 = new m2.public2(); export var k3: m2.public2; - ~~~~~~~~~~ + ~~ !!! error TS4025: Exported variable 'k3' has or is using private name 'm2'. export var l3 = new m2.public2(); ~~ diff --git a/tests/baselines/reference/privacyAccessorDeclFile.errors.txt b/tests/baselines/reference/privacyAccessorDeclFile.errors.txt index 31147f04716..debb5808493 100644 --- a/tests/baselines/reference/privacyAccessorDeclFile.errors.txt +++ b/tests/baselines/reference/privacyAccessorDeclFile.errors.txt @@ -210,12 +210,12 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,35): error TS export class publicClassWithPrivateModuleGetAccessorTypes { static get myPublicStaticMethod(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4040: Return type of public static property getter from exported class has or is using private name 'privateModule'. return null; } get myPublicMethod(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4043: Return type of public property getter from exported class has or is using private name 'privateModule'. return null; } @@ -233,11 +233,11 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,35): error TS export class publicClassWithPrivateModuleSetAccessorTypes { static set myPublicStaticMethod(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateModule'. } set myPublicMethod(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateModule'. } } @@ -436,12 +436,12 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,35): error TS export class publicClassWithPrivateModuleGetAccessorTypes { static get myPublicStaticMethod(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4040: Return type of public static property getter from exported class has or is using private name 'privateModule'. return null; } get myPublicMethod(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4043: Return type of public property getter from exported class has or is using private name 'privateModule'. return null; } @@ -459,11 +459,11 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,35): error TS export class publicClassWithPrivateModuleSetAccessorTypes { static set myPublicStaticMethod(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateModule'. } set myPublicMethod(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateModule'. } } @@ -1112,12 +1112,12 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,35): error TS export class publicClassWithPrivateModuleGetAccessorTypes { static get myPublicStaticMethod(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4040: Return type of public static property getter from exported class has or is using private name 'privateModule'. return null; } get myPublicMethod(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4043: Return type of public property getter from exported class has or is using private name 'privateModule'. return null; } @@ -1135,11 +1135,11 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,35): error TS export class publicClassWithPrivateModuleSetAccessorTypes { static set myPublicStaticMethod(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateModule'. } set myPublicMethod(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateModule'. } } diff --git a/tests/baselines/reference/privacyClassExtendsClauseDeclFile.errors.txt b/tests/baselines/reference/privacyClassExtendsClauseDeclFile.errors.txt index 9bd892d6b69..f3c21baed3c 100644 --- a/tests/baselines/reference/privacyClassExtendsClauseDeclFile.errors.txt +++ b/tests/baselines/reference/privacyClassExtendsClauseDeclFile.errors.txt @@ -30,7 +30,7 @@ tests/cases/compiler/privacyClassExtendsClauseDeclFile_externalModule.ts(69,65): class privateClassExtendingFromPrivateModuleClass extends privateModule.publicClassInPrivateModule { } export class publicClassExtendingFromPrivateModuleClass extends privateModule.publicClassInPrivateModule { // Should error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4020: Extends clause of exported class 'publicClassExtendingFromPrivateModuleClass' has or is using private name 'privateModule'. } } @@ -81,7 +81,7 @@ tests/cases/compiler/privacyClassExtendsClauseDeclFile_externalModule.ts(69,65): class privateClassExtendingFromPrivateModuleClass extends privateModule.publicClassInPrivateModule { } export class publicClassExtendingFromPrivateModuleClass extends privateModule.publicClassInPrivateModule { // Should error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4020: Extends clause of exported class 'publicClassExtendingFromPrivateModuleClass' has or is using private name 'privateModule'. } diff --git a/tests/baselines/reference/privacyClassImplementsClauseDeclFile.errors.txt b/tests/baselines/reference/privacyClassImplementsClauseDeclFile.errors.txt index 6e74ad8b2ad..2681ee0e20e 100644 --- a/tests/baselines/reference/privacyClassImplementsClauseDeclFile.errors.txt +++ b/tests/baselines/reference/privacyClassImplementsClauseDeclFile.errors.txt @@ -29,7 +29,7 @@ tests/cases/compiler/privacyClassImplementsClauseDeclFile_externalModule.ts(68,7 class privateClassImplementingFromPrivateModuleInterface implements privateModule.publicInterfaceInPrivateModule { } export class publicClassImplementingFromPrivateModuleInterface implements privateModule.publicInterfaceInPrivateModule { // Should error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4019: Implements clause of exported class 'publicClassImplementingFromPrivateModuleInterface' has or is using private name 'privateModule'. } @@ -83,7 +83,7 @@ tests/cases/compiler/privacyClassImplementsClauseDeclFile_externalModule.ts(68,7 class privateClassImplementingFromPrivateModuleInterface implements privateModule.publicInterfaceInPrivateModule { } export class publicClassImplementingFromPrivateModuleInterface implements privateModule.publicInterfaceInPrivateModule { // Should error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4019: Implements clause of exported class 'publicClassImplementingFromPrivateModuleInterface' has or is using private name 'privateModule'. } diff --git a/tests/baselines/reference/privacyFunctionParameterDeclFile.errors.txt b/tests/baselines/reference/privacyFunctionParameterDeclFile.errors.txt index 851032858e7..0e88e08e645 100644 --- a/tests/baselines/reference/privacyFunctionParameterDeclFile.errors.txt +++ b/tests/baselines/reference/privacyFunctionParameterDeclFile.errors.txt @@ -180,39 +180,39 @@ tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,89): export interface publicInterfaceWithPrivateModuleParameterTypes { new (param: privateModule.publicClass): publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateModule'. (param: privateModule.publicClass): publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateModule'. myMethod(param: privateModule.publicClass): void; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateModule'. } export class publicClassWithPrivateModuleParameterTypes { static myPublicStaticMethod(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateModule'. } myPublicMethod(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateModule'. } constructor(param: privateModule.publicClass, private param1: privateModule.publicClass, public param2: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateModule'. - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateModule'. - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateModule'. } } export function publicFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4078: Parameter 'param' of exported function has or is using private name 'privateModule'. } export declare function publicAmbientFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass): void; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4078: Parameter 'param' of exported function has or is using private name 'privateModule'. interface privateInterfaceWithPrivateModuleParameterTypes { @@ -352,39 +352,39 @@ tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,89): export interface publicInterfaceWithPrivateModuleParameterTypes { new (param: privateModule.publicClass): publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateModule'. (param: privateModule.publicClass): publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateModule'. myMethod(param: privateModule.publicClass): void; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateModule'. } export class publicClassWithPrivateModuleParameterTypes { static myPublicStaticMethod(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateModule'. } myPublicMethod(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateModule'. } constructor(param: privateModule.publicClass, private param1: privateModule.publicClass, public param2: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateModule'. - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateModule'. - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateModule'. } } export function publicFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4078: Parameter 'param' of exported function has or is using private name 'privateModule'. } export declare function publicAmbientFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass): void; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4078: Parameter 'param' of exported function has or is using private name 'privateModule'. interface privateInterfaceWithPrivateModuleParameterTypes { @@ -813,39 +813,39 @@ tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,89): export interface publicInterfaceWithPrivateModuleParameterTypes { new (param: privateModule.publicClass): publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateModule'. (param: privateModule.publicClass): publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateModule'. myMethod(param: privateModule.publicClass): void; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateModule'. } export class publicClassWithPrivateModuleParameterTypes { static myPublicStaticMethod(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateModule'. } myPublicMethod(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateModule'. } constructor(param: privateModule.publicClass, private param1: privateModule.publicClass, public param2: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateModule'. - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateModule'. - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateModule'. } } export function publicFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4078: Parameter 'param' of exported function has or is using private name 'privateModule'. } export declare function publicAmbientFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass): void; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4078: Parameter 'param' of exported function has or is using private name 'privateModule'. interface privateInterfaceWithPrivateModuleParameterTypes { diff --git a/tests/baselines/reference/privacyFunctionReturnTypeDeclFile.errors.txt b/tests/baselines/reference/privacyFunctionReturnTypeDeclFile.errors.txt index b3aa71a3143..0156c7241f7 100644 --- a/tests/baselines/reference/privacyFunctionReturnTypeDeclFile.errors.txt +++ b/tests/baselines/reference/privacyFunctionReturnTypeDeclFile.errors.txt @@ -264,26 +264,26 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,85) export interface publicInterfaceWithPrivateModuleParameterTypes { new (): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateModule'. (): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4047: Return type of call signature from exported interface has or is using private name 'privateModule'. [x: number]: privateModule.publicClass // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4049: Return type of index signature from exported interface has or is using private name 'privateModule'. myMethod(): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4057: Return type of method from exported interface has or is using private name 'privateModule'. } export class publicClassWithPrivateModuleParameterTypes { static myPublicStaticMethod(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4052: Return type of public static method from exported class has or is using private name 'privateModule'. return null; } myPublicMethod(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4055: Return type of public method from exported class has or is using private name 'privateModule'. return null; } @@ -299,7 +299,7 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,85) } } export function publicFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4060: Return type of exported function has or is using private name 'privateModule'. return null; } @@ -309,7 +309,7 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,85) return new privateModule.publicClass(); } export declare function publicAmbientFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4060: Return type of exported function has or is using private name 'privateModule'. interface privateInterfaceWithPrivateModuleParameterTypes { @@ -537,26 +537,26 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,85) export interface publicInterfaceWithPrivateModuleParameterTypes { new (): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateModule'. (): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4047: Return type of call signature from exported interface has or is using private name 'privateModule'. [x: number]: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4049: Return type of index signature from exported interface has or is using private name 'privateModule'. myMethod(): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4057: Return type of method from exported interface has or is using private name 'privateModule'. } export class publicClassWithPrivateModuleParameterTypes { static myPublicStaticMethod(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4052: Return type of public static method from exported class has or is using private name 'privateModule'. return null; } myPublicMethod(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4055: Return type of public method from exported class has or is using private name 'privateModule'. return null; } @@ -572,7 +572,7 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,85) } } export function publicFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4060: Return type of exported function has or is using private name 'privateModule'. return null; } @@ -582,7 +582,7 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,85) return new privateModule.publicClass(); } export declare function publicAmbientFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4060: Return type of exported function has or is using private name 'privateModule'. interface privateInterfaceWithPrivateModuleParameterTypes { @@ -1314,26 +1314,26 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,85) export interface publicInterfaceWithPrivateModuleParameterTypes { new (): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateModule'. (): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4047: Return type of call signature from exported interface has or is using private name 'privateModule'. [x: number]: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4049: Return type of index signature from exported interface has or is using private name 'privateModule'. myMethod(): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4057: Return type of method from exported interface has or is using private name 'privateModule'. } export class publicClassWithPrivateModuleParameterTypes { static myPublicStaticMethod(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4052: Return type of public static method from exported class has or is using private name 'privateModule'. return null; } myPublicMethod(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4055: Return type of public method from exported class has or is using private name 'privateModule'. return null; } @@ -1349,7 +1349,7 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,85) } } export function publicFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4060: Return type of exported function has or is using private name 'privateModule'. return null; } @@ -1359,7 +1359,7 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,85) return new privateModule.publicClass(); } export declare function publicAmbientFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4060: Return type of exported function has or is using private name 'privateModule'. interface privateInterfaceWithPrivateModuleParameterTypes { diff --git a/tests/baselines/reference/privacyInterfaceExtendsClauseDeclFile.errors.txt b/tests/baselines/reference/privacyInterfaceExtendsClauseDeclFile.errors.txt index dadbaa018ba..41c53ffd19b 100644 --- a/tests/baselines/reference/privacyInterfaceExtendsClauseDeclFile.errors.txt +++ b/tests/baselines/reference/privacyInterfaceExtendsClauseDeclFile.errors.txt @@ -29,7 +29,7 @@ tests/cases/compiler/privacyInterfaceExtendsClauseDeclFile_externalModule.ts(68, interface privateInterfaceImplementingFromPrivateModuleInterface extends privateModule.publicInterfaceInPrivateModule { } export interface publicInterfaceImplementingFromPrivateModuleInterface extends privateModule.publicInterfaceInPrivateModule { // Should error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4022: Extends clause of exported interface 'publicInterfaceImplementingFromPrivateModuleInterface' has or is using private name 'privateModule'. } @@ -83,7 +83,7 @@ tests/cases/compiler/privacyInterfaceExtendsClauseDeclFile_externalModule.ts(68, interface privateInterfaceImplementingFromPrivateModuleInterface extends privateModule.publicInterfaceInPrivateModule { } export interface publicInterfaceImplementingFromPrivateModuleInterface extends privateModule.publicInterfaceInPrivateModule { // Should error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4022: Extends clause of exported interface 'publicInterfaceImplementingFromPrivateModuleInterface' has or is using private name 'privateModule'. } diff --git a/tests/baselines/reference/privacyLocalInternalReferenceImportWithExport.errors.txt b/tests/baselines/reference/privacyLocalInternalReferenceImportWithExport.errors.txt index 5b6d1af921d..45dbc77e7a0 100644 --- a/tests/baselines/reference/privacyLocalInternalReferenceImportWithExport.errors.txt +++ b/tests/baselines/reference/privacyLocalInternalReferenceImportWithExport.errors.txt @@ -59,25 +59,25 @@ tests/cases/compiler/privacyLocalInternalReferenceImportWithExport.ts(57,42): er export module import_public { // Privacy errors - importing private elements export import im_public_c_private = m_private.c_private; - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_c_private' is using private name 'm_private'. export import im_public_e_private = m_private.e_private; - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_e_private' is using private name 'm_private'. export import im_public_f_private = m_private.f_private; - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_f_private' is using private name 'm_private'. export import im_public_v_private = m_private.v_private; - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_v_private' is using private name 'm_private'. export import im_public_i_private = m_private.i_private; - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_i_private' is using private name 'm_private'. export import im_public_mi_private = m_private.mi_private; - ~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_mi_private' is using private name 'm_private'. export import im_public_mu_private = m_private.mu_private; - ~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_mu_private' is using private name 'm_private'. // Usage of privacy error imports diff --git a/tests/baselines/reference/privacyLocalInternalReferenceImportWithoutExport.errors.txt b/tests/baselines/reference/privacyLocalInternalReferenceImportWithoutExport.errors.txt index 0060febb7ad..12fd1927660 100644 --- a/tests/baselines/reference/privacyLocalInternalReferenceImportWithoutExport.errors.txt +++ b/tests/baselines/reference/privacyLocalInternalReferenceImportWithoutExport.errors.txt @@ -57,21 +57,21 @@ tests/cases/compiler/privacyLocalInternalReferenceImportWithoutExport.ts(57,36): export module import_public { // No Privacy errors - importing private elements import im_private_c_private = m_private.c_private; - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_private_c_private' is using private name 'm_private'. import im_private_e_private = m_private.e_private; - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_private_e_private' is using private name 'm_private'. import im_private_f_private = m_private.f_private; import im_private_v_private = m_private.v_private; import im_private_i_private = m_private.i_private; - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_private_i_private' is using private name 'm_private'. import im_private_mi_private = m_private.mi_private; - ~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_private_mi_private' is using private name 'm_private'. import im_private_mu_private = m_private.mu_private; - ~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_private_mu_private' is using private name 'm_private'. // Usage of above decls diff --git a/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithExport.errors.txt b/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithExport.errors.txt index c3708c45311..d3715af1d54 100644 --- a/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithExport.errors.txt +++ b/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithExport.errors.txt @@ -58,25 +58,25 @@ tests/cases/compiler/privacyTopLevelInternalReferenceImportWithExport.ts(56,38): // Privacy errors - importing private elements export import im_public_c_private = m_private.c_private; - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_c_private' is using private name 'm_private'. export import im_public_e_private = m_private.e_private; - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_e_private' is using private name 'm_private'. export import im_public_f_private = m_private.f_private; - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_f_private' is using private name 'm_private'. export import im_public_v_private = m_private.v_private; - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_v_private' is using private name 'm_private'. export import im_public_i_private = m_private.i_private; - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_i_private' is using private name 'm_private'. export import im_public_mi_private = m_private.mi_private; - ~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_mi_private' is using private name 'm_private'. export import im_public_mu_private = m_private.mu_private; - ~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_mu_private' is using private name 'm_private'. // Usage of privacy error imports diff --git a/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithoutExport.errors.txt b/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithoutExport.errors.txt index ac7c865c4f1..1fbf8f7bac9 100644 --- a/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithoutExport.errors.txt +++ b/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithoutExport.errors.txt @@ -57,21 +57,21 @@ tests/cases/compiler/privacyTopLevelInternalReferenceImportWithoutExport.ts(57,3 // No Privacy errors - importing private elements import im_private_c_private = m_private.c_private; - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_private_c_private' is using private name 'm_private'. import im_private_e_private = m_private.e_private; - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_private_e_private' is using private name 'm_private'. import im_private_f_private = m_private.f_private; import im_private_v_private = m_private.v_private; import im_private_i_private = m_private.i_private; - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_private_i_private' is using private name 'm_private'. import im_private_mi_private = m_private.mi_private; - ~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_private_mi_private' is using private name 'm_private'. import im_private_mu_private = m_private.mu_private; - ~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_private_mu_private' is using private name 'm_private'. // Usage of above decls diff --git a/tests/baselines/reference/privacyTypeParameterOfFunctionDeclFile.errors.txt b/tests/baselines/reference/privacyTypeParameterOfFunctionDeclFile.errors.txt index 7d6bebdfd3f..663025ee722 100644 --- a/tests/baselines/reference/privacyTypeParameterOfFunctionDeclFile.errors.txt +++ b/tests/baselines/reference/privacyTypeParameterOfFunctionDeclFile.errors.txt @@ -182,33 +182,33 @@ tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(293,78): error TS export interface publicInterfaceWithPrivatModuleTypeParameters { new (): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4006: Type parameter 'T' of constructor signature from exported interface has or is using private name 'privateModule'. - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateModule'. (): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4008: Type parameter 'T' of call signature from exported interface has or is using private name 'privateModule'. - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4047: Return type of call signature from exported interface has or is using private name 'privateModule'. myMethod(): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4014: Type parameter 'T' of method from exported interface has or is using private name 'privateModule'. - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4057: Return type of method from exported interface has or is using private name 'privateModule'. } export class publicClassWithWithPrivateModuleTypeParameters { static myPublicStaticMethod() { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4010: Type parameter 'T' of public static method from exported class has or is using private name 'privateModule'. } myPublicMethod() { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4012: Type parameter 'T' of public method from exported class has or is using private name 'privateModule'. } } export function publicFunctionWithPrivateMopduleTypeParameters() { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4016: Type parameter 'T' of exported function has or is using private name 'privateModule'. } @@ -374,33 +374,33 @@ tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(293,78): error TS export interface publicInterfaceWithPrivatModuleTypeParameters { new (): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4006: Type parameter 'T' of constructor signature from exported interface has or is using private name 'privateModule'. - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateModule'. (): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4008: Type parameter 'T' of call signature from exported interface has or is using private name 'privateModule'. - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4047: Return type of call signature from exported interface has or is using private name 'privateModule'. myMethod(): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4014: Type parameter 'T' of method from exported interface has or is using private name 'privateModule'. - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4057: Return type of method from exported interface has or is using private name 'privateModule'. } export class publicClassWithWithPrivateModuleTypeParameters { static myPublicStaticMethod() { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4010: Type parameter 'T' of public static method from exported class has or is using private name 'privateModule'. } myPublicMethod() { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4012: Type parameter 'T' of public method from exported class has or is using private name 'privateModule'. } } export function publicFunctionWithPrivateMopduleTypeParameters() { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4016: Type parameter 'T' of exported function has or is using private name 'privateModule'. } diff --git a/tests/baselines/reference/privacyTypeParametersOfClassDeclFile.errors.txt b/tests/baselines/reference/privacyTypeParametersOfClassDeclFile.errors.txt index bccd9c3b05d..a6ae0fdcc01 100644 --- a/tests/baselines/reference/privacyTypeParametersOfClassDeclFile.errors.txt +++ b/tests/baselines/reference/privacyTypeParametersOfClassDeclFile.errors.txt @@ -50,7 +50,7 @@ tests/cases/compiler/privacyTypeParametersOfClassDeclFile.ts(98,75): error TS400 } export class publicClassWithTypeParametersFromPrivateModule { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4002: Type parameter 'T' of exported class has or is using private name 'privateModule'. myMethod(val: T): T { return val; @@ -109,7 +109,7 @@ tests/cases/compiler/privacyTypeParametersOfClassDeclFile.ts(98,75): error TS400 } export class publicClassWithTypeParametersFromPrivateModule { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4002: Type parameter 'T' of exported class has or is using private name 'privateModule'. myMethod(val: T): T { return val; diff --git a/tests/baselines/reference/privacyTypeParametersOfInterfaceDeclFile.errors.txt b/tests/baselines/reference/privacyTypeParametersOfInterfaceDeclFile.errors.txt index b040fdf4fe3..eb6bb3ea734 100644 --- a/tests/baselines/reference/privacyTypeParametersOfInterfaceDeclFile.errors.txt +++ b/tests/baselines/reference/privacyTypeParametersOfInterfaceDeclFile.errors.txt @@ -99,7 +99,7 @@ tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(125,89): error export interface publicInterfaceWithPrivateModuleTypeParameterConstraints { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4004: Type parameter 'T' of exported interface has or is using private name 'privateModule'. } @@ -184,7 +184,7 @@ tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(125,89): error } export interface publicInterfaceWithPrivateModuleTypeParameterConstraints { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4004: Type parameter 'T' of exported interface has or is using private name 'privateModule'. } diff --git a/tests/baselines/reference/privacyVarDeclFile.errors.txt b/tests/baselines/reference/privacyVarDeclFile.errors.txt index 528b5c3c66f..6ae5373e0c7 100644 --- a/tests/baselines/reference/privacyVarDeclFile.errors.txt +++ b/tests/baselines/reference/privacyVarDeclFile.errors.txt @@ -104,22 +104,22 @@ tests/cases/compiler/privacyVarDeclFile_externalModule.ts(151,72): error TS4025: export interface publicInterfaceWithPrivateModulePropertyTypes { myProperty: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateModule'. } export class publicClassWithPrivateModulePropertyTypes { static myPublicStaticProperty: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateModule'. myPublicProperty: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateModule'. } export var publicVarWithPrivateModulePropertyTypes: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4025: Exported variable 'publicVarWithPrivateModulePropertyTypes' has or is using private name 'privateModule'. export declare var publicAmbientVarWithPrivateModulePropertyTypes: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4025: Exported variable 'publicAmbientVarWithPrivateModulePropertyTypes' has or is using private name 'privateModule'. interface privateInterfaceWithPrivateModulePropertyTypes { @@ -205,22 +205,22 @@ tests/cases/compiler/privacyVarDeclFile_externalModule.ts(151,72): error TS4025: export interface publicInterfaceWithPrivateModulePropertyTypes { myProperty: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateModule'. } export class publicClassWithPrivateModulePropertyTypes { static myPublicStaticProperty: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateModule'. myPublicProperty: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateModule'. } export var publicVarWithPrivateModulePropertyTypes: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4025: Exported variable 'publicVarWithPrivateModulePropertyTypes' has or is using private name 'privateModule'. export declare var publicAmbientVarWithPrivateModulePropertyTypes: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4025: Exported variable 'publicAmbientVarWithPrivateModulePropertyTypes' has or is using private name 'privateModule'. interface privateInterfaceWithPrivateModulePropertyTypes { @@ -486,22 +486,22 @@ tests/cases/compiler/privacyVarDeclFile_externalModule.ts(151,72): error TS4025: export interface publicInterfaceWithPrivateModulePropertyTypes { myProperty: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateModule'. } export class publicClassWithPrivateModulePropertyTypes { static myPublicStaticProperty: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateModule'. myPublicProperty: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateModule'. } export var publicVarWithPrivateModulePropertyTypes: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4025: Exported variable 'publicVarWithPrivateModulePropertyTypes' has or is using private name 'privateModule'. export declare var publicAmbientVarWithPrivateModulePropertyTypes: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4025: Exported variable 'publicAmbientVarWithPrivateModulePropertyTypes' has or is using private name 'privateModule'. interface privateInterfaceWithPrivateModulePropertyTypes {