This type represents the expression+type arguments you can get in a class or interface heritage clause section. For class-implements clauses, or interface-extends clauses, these expressions can only be identifiers or dotted names. For class extends clauses, these could be any expressions in the future. However, for now, we only support identifiers and dotted names.
167 lines
2.9 KiB
Text
167 lines
2.9 KiB
Text
=== tests/cases/compiler/declFileGenericType.ts ===
|
|
export module C {
|
|
>C : typeof C
|
|
|
|
export class A<T>{ }
|
|
>A : A<T>
|
|
>T : T
|
|
|
|
export class B { }
|
|
>B : B
|
|
|
|
export function F<T>(x: T): A<B> { return null; }
|
|
>F : <T>(x: T) => A<B>
|
|
>T : T
|
|
>x : T
|
|
>T : T
|
|
>A : A<T>
|
|
>B : B
|
|
|
|
export function F2<T>(x: T): C.A<C.B> { return null; }
|
|
>F2 : <T>(x: T) => A<B>
|
|
>T : T
|
|
>x : T
|
|
>T : T
|
|
>C : unknown
|
|
>A : A<T>
|
|
>C : unknown
|
|
>B : B
|
|
|
|
export function F3<T>(x: T): C.A<C.B>[] { return null; }
|
|
>F3 : <T>(x: T) => A<B>[]
|
|
>T : T
|
|
>x : T
|
|
>T : T
|
|
>C : unknown
|
|
>A : A<T>
|
|
>C : unknown
|
|
>B : B
|
|
|
|
export function F4<T extends A<B>>(x: T): Array<C.A<C.B>> { return null; }
|
|
>F4 : <T extends A<B>>(x: T) => A<B>[]
|
|
>T : T
|
|
>A : A<T>
|
|
>B : B
|
|
>x : T
|
|
>T : T
|
|
>Array : T[]
|
|
>C : unknown
|
|
>A : A<T>
|
|
>C : unknown
|
|
>B : B
|
|
|
|
export function F5<T>(): T { return null; }
|
|
>F5 : <T>() => T
|
|
>T : T
|
|
>T : T
|
|
|
|
export function F6<T extends A<B>>(x: T): T { return null; }
|
|
>F6 : <T extends A<B>>(x: T) => T
|
|
>T : T
|
|
>A : A<T>
|
|
>B : B
|
|
>x : T
|
|
>T : T
|
|
>T : T
|
|
|
|
export class D<T>{
|
|
>D : D<T>
|
|
>T : T
|
|
|
|
constructor(public val: T) { }
|
|
>val : T
|
|
>T : T
|
|
|
|
}
|
|
}
|
|
|
|
export var a: C.A<C.B>;
|
|
>a : C.A<C.B>
|
|
>C : unknown
|
|
>A : C.A<T>
|
|
>C : unknown
|
|
>B : C.B
|
|
|
|
export var b = C.F;
|
|
>b : <T>(x: T) => C.A<C.B>
|
|
>C.F : <T>(x: T) => C.A<C.B>
|
|
>C : typeof C
|
|
>F : <T>(x: T) => C.A<C.B>
|
|
|
|
export var c = C.F2;
|
|
>c : <T>(x: T) => C.A<C.B>
|
|
>C.F2 : <T>(x: T) => C.A<C.B>
|
|
>C : typeof C
|
|
>F2 : <T>(x: T) => C.A<C.B>
|
|
|
|
export var d = C.F3;
|
|
>d : <T>(x: T) => C.A<C.B>[]
|
|
>C.F3 : <T>(x: T) => C.A<C.B>[]
|
|
>C : typeof C
|
|
>F3 : <T>(x: T) => C.A<C.B>[]
|
|
|
|
export var e = C.F4;
|
|
>e : <T extends C.A<C.B>>(x: T) => C.A<C.B>[]
|
|
>C.F4 : <T extends C.A<C.B>>(x: T) => C.A<C.B>[]
|
|
>C : typeof C
|
|
>F4 : <T extends C.A<C.B>>(x: T) => C.A<C.B>[]
|
|
|
|
export var x = (new C.D<C.A<C.B>>(new C.A<C.B>())).val;
|
|
>x : C.A<C.B>
|
|
>(new C.D<C.A<C.B>>(new C.A<C.B>())).val : C.A<C.B>
|
|
>(new C.D<C.A<C.B>>(new C.A<C.B>())) : C.D<C.A<C.B>>
|
|
>new C.D<C.A<C.B>>(new C.A<C.B>()) : C.D<C.A<C.B>>
|
|
>C.D : typeof C.D
|
|
>C : typeof C
|
|
>D : typeof C.D
|
|
>C : unknown
|
|
>A : C.A<T>
|
|
>C : unknown
|
|
>B : C.B
|
|
>new C.A<C.B>() : C.A<C.B>
|
|
>C.A : typeof C.A
|
|
>C : typeof C
|
|
>A : typeof C.A
|
|
>C : unknown
|
|
>B : C.B
|
|
>val : C.A<C.B>
|
|
|
|
export function f<T extends C.A<C.B>>() { }
|
|
>f : <T extends C.A<C.B>>() => void
|
|
>T : T
|
|
>C : unknown
|
|
>A : C.A<T>
|
|
>C : unknown
|
|
>B : C.B
|
|
|
|
export var g = C.F5<C.A<C.B>>();
|
|
>g : C.A<C.B>
|
|
>C.F5<C.A<C.B>>() : C.A<C.B>
|
|
>C.F5 : <T>() => T
|
|
>C : typeof C
|
|
>F5 : <T>() => T
|
|
>C : unknown
|
|
>A : C.A<T>
|
|
>C : unknown
|
|
>B : C.B
|
|
|
|
export class h extends C.A<C.B>{ }
|
|
>h : h
|
|
>C : typeof C
|
|
>A : C.A<T>
|
|
>C : unknown
|
|
>B : C.B
|
|
|
|
export interface i extends C.A<C.B> { }
|
|
>i : i
|
|
>C : typeof C
|
|
>A : C.A<T>
|
|
>C : unknown
|
|
>B : C.B
|
|
|
|
export var j = C.F6;
|
|
>j : <T extends C.A<C.B>>(x: T) => T
|
|
>C.F6 : <T extends C.A<C.B>>(x: T) => T
|
|
>C : typeof C
|
|
>F6 : <T extends C.A<C.B>>(x: T) => T
|
|
|