46 lines
No EOL
1.3 KiB
Text
46 lines
No EOL
1.3 KiB
Text
==== tests/cases/compiler/privacyTypeParametersOfClass.ts (1 errors) ====
|
|
class privateClass {
|
|
}
|
|
|
|
export class publicClass {
|
|
~~~~~~~~~~~
|
|
!!! Cannot compile external modules unless the '--module' flag is provided.
|
|
}
|
|
|
|
// TypeParameter_0_of_exported_class_1_has_or_is_using_private_type_2
|
|
export class publicClassWithPrivateTypeParameters<T extends privateClass> {
|
|
myMethod(val: T): T { // Error
|
|
return val;
|
|
}
|
|
}
|
|
|
|
export class publicClassWithPublicTypeParameters<T extends publicClass> {
|
|
myMethod(val: T): T { // No Error
|
|
return val;
|
|
}
|
|
}
|
|
|
|
class privateClassWithPrivateTypeParameters<T extends privateClass> {
|
|
myMethod(val: T): T { // No Error
|
|
return val;
|
|
}
|
|
}
|
|
|
|
class privateClassWithPublicTypeParameters<T extends publicClass> {
|
|
myMethod(val: T): T { // No Error
|
|
return val;
|
|
}
|
|
}
|
|
|
|
export class publicClassWithPublicTypeParametersWithoutExtends<T> {
|
|
myMethod(val: T): T { // No Error
|
|
return val;
|
|
}
|
|
}
|
|
|
|
class privateClassWithPublicTypeParametersWithoutExtends<T> {
|
|
myMethod(val: T): T { // No Error
|
|
return val;
|
|
}
|
|
}
|
|
|