169 lines
No EOL
5.8 KiB
Text
169 lines
No EOL
5.8 KiB
Text
tests/cases/compiler/privacyTypeParametersOfClassDeclFile.ts(7,61): error TS4002: Type parameter 'T' of exported class has or is using private name 'privateClass'.
|
|
tests/cases/compiler/privacyTypeParametersOfClassDeclFile.ts(43,71): error TS4002: Type parameter 'T' of exported class has or is using private name 'privateModule'.
|
|
tests/cases/compiler/privacyTypeParametersOfClassDeclFile.ts(62,65): error TS4002: Type parameter 'T' of exported class has or is using private name 'privateClassInPublicModule'.
|
|
tests/cases/compiler/privacyTypeParametersOfClassDeclFile.ts(98,75): error TS4002: Type parameter 'T' of exported class has or is using private name 'privateModule'.
|
|
|
|
|
|
==== tests/cases/compiler/privacyTypeParametersOfClassDeclFile.ts (4 errors) ====
|
|
class privateClass {
|
|
}
|
|
|
|
export class publicClass {
|
|
}
|
|
|
|
export class publicClassWithPrivateTypeParameters<T extends privateClass> { // Error
|
|
~~~~~~~~~~~~
|
|
!!! error TS4002: Type parameter 'T' of exported class has or is using private name 'privateClass'.
|
|
myMethod(val: T): T {
|
|
return val;
|
|
}
|
|
}
|
|
|
|
export class publicClassWithPublicTypeParameters<T extends publicClass> {
|
|
myMethod(val: T): T {
|
|
return val;
|
|
}
|
|
}
|
|
|
|
class privateClassWithPrivateTypeParameters<T extends privateClass> {
|
|
myMethod(val: T): T {
|
|
return val;
|
|
}
|
|
}
|
|
|
|
class privateClassWithPublicTypeParameters<T extends publicClass> {
|
|
myMethod(val: T): T {
|
|
return val;
|
|
}
|
|
}
|
|
|
|
export class publicClassWithPublicTypeParametersWithoutExtends<T> {
|
|
myMethod(val: T): T {
|
|
return val;
|
|
}
|
|
}
|
|
|
|
class privateClassWithPublicTypeParametersWithoutExtends<T> {
|
|
myMethod(val: T): T {
|
|
return val;
|
|
}
|
|
}
|
|
|
|
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;
|
|
}
|
|
}
|
|
|
|
class privateClassWithTypeParametersFromPrivateModule<T extends privateModule.publicClassInPrivateModule> {
|
|
myMethod(val: T): T {
|
|
return val;
|
|
}
|
|
}
|
|
|
|
export module publicModule {
|
|
class privateClassInPublicModule {
|
|
}
|
|
|
|
export class publicClassInPublicModule {
|
|
}
|
|
|
|
export class publicClassWithPrivateTypeParameters<T extends privateClassInPublicModule> { // Error
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS4002: Type parameter 'T' of exported class has or is using private name 'privateClassInPublicModule'.
|
|
myMethod(val: T): T {
|
|
return val;
|
|
}
|
|
}
|
|
|
|
export class publicClassWithPublicTypeParameters<T extends publicClassInPublicModule> {
|
|
myMethod(val: T): T {
|
|
return val;
|
|
}
|
|
}
|
|
|
|
class privateClassWithPrivateTypeParameters<T extends privateClassInPublicModule> {
|
|
myMethod(val: T): T {
|
|
return val;
|
|
}
|
|
}
|
|
|
|
class privateClassWithPublicTypeParameters<T extends publicClassInPublicModule> {
|
|
myMethod(val: T): T {
|
|
return val;
|
|
}
|
|
}
|
|
|
|
export class publicClassWithPublicTypeParametersWithoutExtends<T> {
|
|
myMethod(val: T): T {
|
|
return val;
|
|
}
|
|
}
|
|
|
|
class privateClassWithPublicTypeParametersWithoutExtends<T> {
|
|
myMethod(val: T): T {
|
|
return val;
|
|
}
|
|
}
|
|
|
|
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;
|
|
}
|
|
}
|
|
|
|
class privateClassWithTypeParametersFromPrivateModule<T extends privateModule.publicClassInPrivateModule> {
|
|
myMethod(val: T): T {
|
|
return val;
|
|
}
|
|
}
|
|
}
|
|
|
|
module privateModule {
|
|
class privateClassInPrivateModule {
|
|
}
|
|
|
|
export class publicClassInPrivateModule {
|
|
}
|
|
|
|
export class publicClassWithPrivateTypeParameters<T extends privateClassInPrivateModule> {
|
|
myMethod(val: T): T {
|
|
return val;
|
|
}
|
|
}
|
|
|
|
export class publicClassWithPublicTypeParameters<T extends publicClassInPrivateModule> {
|
|
myMethod(val: T): T {
|
|
return val;
|
|
}
|
|
}
|
|
|
|
class privateClassWithPrivateTypeParameters<T extends privateClassInPrivateModule> {
|
|
myMethod(val: T): T {
|
|
return val;
|
|
}
|
|
}
|
|
|
|
class privateClassWithPublicTypeParameters<T extends publicClassInPrivateModule> {
|
|
myMethod(val: T): T {
|
|
return val;
|
|
}
|
|
}
|
|
|
|
export class publicClassWithPublicTypeParametersWithoutExtends<T> {
|
|
myMethod(val: T): T {
|
|
return val;
|
|
}
|
|
}
|
|
|
|
class privateClassWithPublicTypeParametersWithoutExtends<T> {
|
|
myMethod(val: T): T {
|
|
return val;
|
|
}
|
|
}
|
|
}
|
|
|