2014-11-11 00:56:18 +01:00
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'.
2014-09-12 22:35:07 +02:00
2014-07-19 03:11:04 +02:00
==== tests/cases/compiler/privacyTypeParametersOfClassDeclFile.ts (4 errors) ====
class privateClass {
}
export class publicClass {
}
export class publicClassWithPrivateTypeParameters<T extends privateClass> { // Error
2014-11-11 00:56:18 +01:00
~~~~~~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS4002: Type parameter 'T' of exported class has or is using private name 'privateClass'.
2014-07-19 03:11:04 +02:00
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
2014-11-11 00:56:18 +01:00
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS4002: Type parameter 'T' of exported class has or is using private name 'privateModule'.
2014-07-19 03:11:04 +02:00
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
2014-11-11 00:56:18 +01:00
~~~~~~~~~~~~~~~~~~~~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS4002: Type parameter 'T' of exported class has or is using private name 'privateClassInPublicModule'.
2014-07-19 03:11:04 +02:00
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
2014-11-11 00:56:18 +01:00
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS4002: Type parameter 'T' of exported class has or is using private name 'privateModule'.
2014-07-19 03:11:04 +02:00
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;
}
}
}