mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 03:23:08 -06:00
Show error for visibility only on the identifier resulting the error
This commit is contained in:
parent
acff59f029
commit
60f79da623
@ -1001,9 +1001,10 @@ module ts {
|
||||
var symbol = resolveName(enclosingDeclaration, (<Identifier>firstIdentifier).text, meaning, /*nodeNotFoundErrorMessage*/ undefined, /*nameArg*/ undefined);
|
||||
|
||||
// Verify if the symbol is accessible
|
||||
return hasVisibleDeclarations(symbol) || <SymbolAccessiblityResult>{
|
||||
return hasVisibleDeclarations(symbol) || <SymbolVisibilityResult>{
|
||||
accessibility: SymbolAccessibility.NotAccessible,
|
||||
errorSymbolName: getTextOfNode(firstIdentifier),
|
||||
errorNode: firstIdentifier
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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()) {
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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'.
|
||||
}
|
||||
|
||||
@ -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;
|
||||
~~
|
||||
|
||||
@ -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();
|
||||
~~
|
||||
|
||||
@ -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'.
|
||||
}
|
||||
}
|
||||
|
||||
@ -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'.
|
||||
}
|
||||
|
||||
|
||||
@ -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'.
|
||||
}
|
||||
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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'.
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -182,33 +182,33 @@ tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(293,78): error TS
|
||||
|
||||
export interface publicInterfaceWithPrivatModuleTypeParameters {
|
||||
new <T extends privateModule.publicClass>(): 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'.
|
||||
<T extends privateModule.publicClass>(): 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<T extends privateModule.publicClass>(): 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<T extends privateModule.publicClass>() { // Error
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS4010: Type parameter 'T' of public static method from exported class has or is using private name 'privateModule'.
|
||||
}
|
||||
myPublicMethod<T extends privateModule.publicClass>() { // Error
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS4012: Type parameter 'T' of public method from exported class has or is using private name 'privateModule'.
|
||||
}
|
||||
}
|
||||
export function publicFunctionWithPrivateMopduleTypeParameters<T extends privateModule.publicClass>() { // 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 <T extends privateModule.publicClass>(): 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'.
|
||||
<T extends privateModule.publicClass>(): 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<T extends privateModule.publicClass>(): 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<T extends privateModule.publicClass>() { // Error
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS4010: Type parameter 'T' of public static method from exported class has or is using private name 'privateModule'.
|
||||
}
|
||||
myPublicMethod<T extends privateModule.publicClass>() { // Error
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS4012: Type parameter 'T' of public method from exported class has or is using private name 'privateModule'.
|
||||
}
|
||||
}
|
||||
export function publicFunctionWithPrivateMopduleTypeParameters<T extends privateModule.publicClass>() { // Error
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS4016: Type parameter 'T' of exported function has or is using private name 'privateModule'.
|
||||
}
|
||||
|
||||
|
||||
@ -50,7 +50,7 @@ tests/cases/compiler/privacyTypeParametersOfClassDeclFile.ts(98,75): error TS400
|
||||
}
|
||||
|
||||
export class publicClassWithTypeParametersFromPrivateModule<T extends privateModule.publicClassInPrivateModule> { // 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<T extends privateModule.publicClassInPrivateModule> { // Error
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS4002: Type parameter 'T' of exported class has or is using private name 'privateModule'.
|
||||
myMethod(val: T): T {
|
||||
return val;
|
||||
|
||||
@ -99,7 +99,7 @@ tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(125,89): error
|
||||
|
||||
|
||||
export interface publicInterfaceWithPrivateModuleTypeParameterConstraints<T extends privateModule.publicClassInPrivateModule> { // 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<T extends privateModule.publicClassInPrivateModule> { // Error
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS4004: Type parameter 'T' of exported interface has or is using private name 'privateModule'.
|
||||
}
|
||||
|
||||
|
||||
@ -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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user