303 lines
9 KiB
Text
303 lines
9 KiB
Text
=== tests/cases/compiler/privacyTypeParameterOfFunction.ts ===
|
|
class privateClass {
|
|
>privateClass : privateClass
|
|
}
|
|
|
|
export class publicClass {
|
|
>publicClass : publicClass
|
|
}
|
|
|
|
export interface publicInterfaceWithPrivateTypeParameters {
|
|
>publicInterfaceWithPrivateTypeParameters : publicInterfaceWithPrivateTypeParameters
|
|
|
|
// TypeParameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_type_1
|
|
new <T extends privateClass>(): privateClass;
|
|
>T : T
|
|
>privateClass : privateClass
|
|
>privateClass : privateClass
|
|
|
|
// TypeParameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_type_1
|
|
<T extends privateClass>(): privateClass;
|
|
>T : T
|
|
>privateClass : privateClass
|
|
>privateClass : privateClass
|
|
|
|
// TypeParameter_0_of_method_from_exported_interface_has_or_is_using_private_type_1
|
|
myMethod<T extends privateClass>(): privateClass;
|
|
>myMethod : <T extends privateClass>() => privateClass
|
|
>T : T
|
|
>privateClass : privateClass
|
|
>privateClass : privateClass
|
|
}
|
|
|
|
export interface publicInterfaceWithPublicTypeParameters {
|
|
>publicInterfaceWithPublicTypeParameters : publicInterfaceWithPublicTypeParameters
|
|
|
|
new <T extends publicClass>(): publicClass;
|
|
>T : T
|
|
>publicClass : publicClass
|
|
>publicClass : publicClass
|
|
|
|
<T extends publicClass>(): publicClass;
|
|
>T : T
|
|
>publicClass : publicClass
|
|
>publicClass : publicClass
|
|
|
|
myMethod<T extends publicClass>(): publicClass;
|
|
>myMethod : <T extends publicClass>() => publicClass
|
|
>T : T
|
|
>publicClass : publicClass
|
|
>publicClass : publicClass
|
|
}
|
|
|
|
interface privateInterfaceWithPrivateTypeParameters {
|
|
>privateInterfaceWithPrivateTypeParameters : privateInterfaceWithPrivateTypeParameters
|
|
|
|
new <T extends privateClass>(): privateClass;
|
|
>T : T
|
|
>privateClass : privateClass
|
|
>privateClass : privateClass
|
|
|
|
<T extends privateClass>(): privateClass;
|
|
>T : T
|
|
>privateClass : privateClass
|
|
>privateClass : privateClass
|
|
|
|
myMethod<T extends privateClass>(): privateClass;
|
|
>myMethod : <T extends privateClass>() => privateClass
|
|
>T : T
|
|
>privateClass : privateClass
|
|
>privateClass : privateClass
|
|
}
|
|
|
|
interface privateInterfaceWithPublicTypeParameters {
|
|
>privateInterfaceWithPublicTypeParameters : privateInterfaceWithPublicTypeParameters
|
|
|
|
new <T extends publicClass>(): publicClass;
|
|
>T : T
|
|
>publicClass : publicClass
|
|
>publicClass : publicClass
|
|
|
|
<T extends publicClass>(): publicClass;
|
|
>T : T
|
|
>publicClass : publicClass
|
|
>publicClass : publicClass
|
|
|
|
myMethod<T extends publicClass>(): publicClass;
|
|
>myMethod : <T extends publicClass>() => publicClass
|
|
>T : T
|
|
>publicClass : publicClass
|
|
>publicClass : publicClass
|
|
}
|
|
|
|
export class publicClassWithWithPrivateTypeParameters {
|
|
>publicClassWithWithPrivateTypeParameters : publicClassWithWithPrivateTypeParameters
|
|
|
|
// TypeParameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_type_1
|
|
static myPublicStaticMethod<T extends privateClass>() {
|
|
>myPublicStaticMethod : <T extends privateClass>() => void
|
|
>T : T
|
|
>privateClass : privateClass
|
|
}
|
|
private static myPrivateStaticMethod<T extends privateClass>() { // No error
|
|
>myPrivateStaticMethod : <T extends privateClass>() => void
|
|
>T : T
|
|
>privateClass : privateClass
|
|
}
|
|
// TypeParameter_0_of_public_method_from_exported_class_has_or_is_using_private_type_1
|
|
myPublicMethod<T extends privateClass>() {
|
|
>myPublicMethod : <T extends privateClass>() => void
|
|
>T : T
|
|
>privateClass : privateClass
|
|
}
|
|
private myPrivateMethod<T extends privateClass>() { // No error
|
|
>myPrivateMethod : <T extends privateClass>() => void
|
|
>T : T
|
|
>privateClass : privateClass
|
|
}
|
|
}
|
|
|
|
export class publicClassWithWithPublicTypeParameters {
|
|
>publicClassWithWithPublicTypeParameters : publicClassWithWithPublicTypeParameters
|
|
|
|
static myPublicStaticMethod<T extends publicClass>() {
|
|
>myPublicStaticMethod : <T extends publicClass>() => void
|
|
>T : T
|
|
>publicClass : publicClass
|
|
}
|
|
private static myPrivateStaticMethod<T extends publicClass>() {
|
|
>myPrivateStaticMethod : <T extends publicClass>() => void
|
|
>T : T
|
|
>publicClass : publicClass
|
|
}
|
|
myPublicMethod<T extends publicClass>() {
|
|
>myPublicMethod : <T extends publicClass>() => void
|
|
>T : T
|
|
>publicClass : publicClass
|
|
}
|
|
private myPrivateMethod<T extends publicClass>() {
|
|
>myPrivateMethod : <T extends publicClass>() => void
|
|
>T : T
|
|
>publicClass : publicClass
|
|
}
|
|
}
|
|
|
|
class privateClassWithWithPrivateTypeParameters {
|
|
>privateClassWithWithPrivateTypeParameters : privateClassWithWithPrivateTypeParameters
|
|
|
|
static myPublicStaticMethod<T extends privateClass>() {
|
|
>myPublicStaticMethod : <T extends privateClass>() => void
|
|
>T : T
|
|
>privateClass : privateClass
|
|
}
|
|
private static myPrivateStaticMethod<T extends privateClass>() { // No error
|
|
>myPrivateStaticMethod : <T extends privateClass>() => void
|
|
>T : T
|
|
>privateClass : privateClass
|
|
}
|
|
myPublicMethod<T extends privateClass>() {
|
|
>myPublicMethod : <T extends privateClass>() => void
|
|
>T : T
|
|
>privateClass : privateClass
|
|
}
|
|
private myPrivateMethod<T extends privateClass>() { // No error
|
|
>myPrivateMethod : <T extends privateClass>() => void
|
|
>T : T
|
|
>privateClass : privateClass
|
|
}
|
|
}
|
|
|
|
class privateClassWithWithPublicTypeParameters {
|
|
>privateClassWithWithPublicTypeParameters : privateClassWithWithPublicTypeParameters
|
|
|
|
static myPublicStaticMethod<T extends publicClass>() {
|
|
>myPublicStaticMethod : <T extends publicClass>() => void
|
|
>T : T
|
|
>publicClass : publicClass
|
|
}
|
|
private static myPrivateStaticMethod<T extends publicClass>() {
|
|
>myPrivateStaticMethod : <T extends publicClass>() => void
|
|
>T : T
|
|
>publicClass : publicClass
|
|
}
|
|
myPublicMethod<T extends publicClass>() {
|
|
>myPublicMethod : <T extends publicClass>() => void
|
|
>T : T
|
|
>publicClass : publicClass
|
|
}
|
|
private myPrivateMethod<T extends publicClass>() {
|
|
>myPrivateMethod : <T extends publicClass>() => void
|
|
>T : T
|
|
>publicClass : publicClass
|
|
}
|
|
}
|
|
|
|
// TypeParameter_0_of_exported_function_has_or_is_using_private_type_1
|
|
export function publicFunctionWithPrivateTypeParameters<T extends privateClass>() {
|
|
>publicFunctionWithPrivateTypeParameters : <T extends privateClass>() => void
|
|
>T : T
|
|
>privateClass : privateClass
|
|
}
|
|
|
|
export function publicFunctionWithPublicTypeParameters<T extends publicClass>() {
|
|
>publicFunctionWithPublicTypeParameters : <T extends publicClass>() => void
|
|
>T : T
|
|
>publicClass : publicClass
|
|
}
|
|
|
|
function privateFunctionWithPrivateTypeParameters<T extends privateClass>() {
|
|
>privateFunctionWithPrivateTypeParameters : <T extends privateClass>() => void
|
|
>T : T
|
|
>privateClass : privateClass
|
|
}
|
|
|
|
function privateFunctionWithPublicTypeParameters<T extends publicClass>() {
|
|
>privateFunctionWithPublicTypeParameters : <T extends publicClass>() => void
|
|
>T : T
|
|
>publicClass : publicClass
|
|
}
|
|
|
|
export interface publicInterfaceWithPublicTypeParametersWithoutExtends {
|
|
>publicInterfaceWithPublicTypeParametersWithoutExtends : publicInterfaceWithPublicTypeParametersWithoutExtends
|
|
|
|
new <T>(): publicClass;
|
|
>T : T
|
|
>publicClass : publicClass
|
|
|
|
<T>(): publicClass;
|
|
>T : T
|
|
>publicClass : publicClass
|
|
|
|
myMethod<T>(): publicClass;
|
|
>myMethod : <T>() => publicClass
|
|
>T : T
|
|
>publicClass : publicClass
|
|
}
|
|
|
|
interface privateInterfaceWithPublicTypeParametersWithoutExtends {
|
|
>privateInterfaceWithPublicTypeParametersWithoutExtends : privateInterfaceWithPublicTypeParametersWithoutExtends
|
|
|
|
new <T>(): publicClass;
|
|
>T : T
|
|
>publicClass : publicClass
|
|
|
|
<T>(): publicClass;
|
|
>T : T
|
|
>publicClass : publicClass
|
|
|
|
myMethod<T>(): publicClass;
|
|
>myMethod : <T>() => publicClass
|
|
>T : T
|
|
>publicClass : publicClass
|
|
}
|
|
|
|
export class publicClassWithWithPublicTypeParametersWithoutExtends {
|
|
>publicClassWithWithPublicTypeParametersWithoutExtends : publicClassWithWithPublicTypeParametersWithoutExtends
|
|
|
|
static myPublicStaticMethod<T>() {
|
|
>myPublicStaticMethod : <T>() => void
|
|
>T : T
|
|
}
|
|
private static myPrivateStaticMethod<T>() {
|
|
>myPrivateStaticMethod : <T>() => void
|
|
>T : T
|
|
}
|
|
myPublicMethod<T>() {
|
|
>myPublicMethod : <T>() => void
|
|
>T : T
|
|
}
|
|
private myPrivateMethod<T>() {
|
|
>myPrivateMethod : <T>() => void
|
|
>T : T
|
|
}
|
|
}
|
|
class privateClassWithWithPublicTypeParametersWithoutExtends {
|
|
>privateClassWithWithPublicTypeParametersWithoutExtends : privateClassWithWithPublicTypeParametersWithoutExtends
|
|
|
|
static myPublicStaticMethod<T>() {
|
|
>myPublicStaticMethod : <T>() => void
|
|
>T : T
|
|
}
|
|
private static myPrivateStaticMethod<T>() {
|
|
>myPrivateStaticMethod : <T>() => void
|
|
>T : T
|
|
}
|
|
myPublicMethod<T>() {
|
|
>myPublicMethod : <T>() => void
|
|
>T : T
|
|
}
|
|
private myPrivateMethod<T>() {
|
|
>myPrivateMethod : <T>() => void
|
|
>T : T
|
|
}
|
|
}
|
|
|
|
export function publicFunctionWithPublicTypeParametersWithoutExtends<T>() {
|
|
>publicFunctionWithPublicTypeParametersWithoutExtends : <T>() => void
|
|
>T : T
|
|
}
|
|
|
|
function privateFunctionWithPublicTypeParametersWithoutExtends<T>() {
|
|
>privateFunctionWithPublicTypeParametersWithoutExtends : <T>() => void
|
|
>T : T
|
|
}
|