147 lines
6.7 KiB
Text
147 lines
6.7 KiB
Text
=== tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction3.ts ===
|
|
// satisfaction of a constraint to Function, no errors expected
|
|
|
|
function foo<T extends (x: string) => string>(x: T): T { return x; }
|
|
>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 0, 0))
|
|
>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 2, 13))
|
|
>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 2, 24))
|
|
>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 2, 46))
|
|
>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 2, 13))
|
|
>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 2, 13))
|
|
>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 2, 46))
|
|
|
|
interface I {
|
|
>I : Symbol(I, Decl(functionConstraintSatisfaction3.ts, 2, 68))
|
|
|
|
(): string;
|
|
}
|
|
var i: I;
|
|
>i : Symbol(i, Decl(functionConstraintSatisfaction3.ts, 7, 3))
|
|
>I : Symbol(I, Decl(functionConstraintSatisfaction3.ts, 2, 68))
|
|
|
|
class C {
|
|
>C : Symbol(C, Decl(functionConstraintSatisfaction3.ts, 7, 9))
|
|
|
|
foo: string;
|
|
>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 9, 9))
|
|
}
|
|
|
|
var a: { (): string };
|
|
>a : Symbol(a, Decl(functionConstraintSatisfaction3.ts, 13, 3))
|
|
|
|
var b: { new (): string };
|
|
>b : Symbol(b, Decl(functionConstraintSatisfaction3.ts, 14, 3))
|
|
|
|
var c: { (): string; (x): string };
|
|
>c : Symbol(c, Decl(functionConstraintSatisfaction3.ts, 15, 3))
|
|
>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 15, 22))
|
|
|
|
var r1 = foo((x) => x);
|
|
>r1 : Symbol(r1, Decl(functionConstraintSatisfaction3.ts, 17, 3))
|
|
>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 0, 0))
|
|
>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 17, 14))
|
|
>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 17, 14))
|
|
|
|
var r2 = foo((x: string) => x);
|
|
>r2 : Symbol(r2, Decl(functionConstraintSatisfaction3.ts, 18, 3))
|
|
>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 0, 0))
|
|
>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 18, 14))
|
|
>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 18, 14))
|
|
|
|
var r3 = foo(function (x) { return x });
|
|
>r3 : Symbol(r3, Decl(functionConstraintSatisfaction3.ts, 19, 3))
|
|
>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 0, 0))
|
|
>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 19, 23))
|
|
>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 19, 23))
|
|
|
|
var r4 = foo(function (x: string) { return x });
|
|
>r4 : Symbol(r4, Decl(functionConstraintSatisfaction3.ts, 20, 3))
|
|
>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 0, 0))
|
|
>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 20, 23))
|
|
>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 20, 23))
|
|
|
|
var r5 = foo(i);
|
|
>r5 : Symbol(r5, Decl(functionConstraintSatisfaction3.ts, 21, 3))
|
|
>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 0, 0))
|
|
>i : Symbol(i, Decl(functionConstraintSatisfaction3.ts, 7, 3))
|
|
|
|
var r8 = foo(c);
|
|
>r8 : Symbol(r8, Decl(functionConstraintSatisfaction3.ts, 22, 3))
|
|
>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 0, 0))
|
|
>c : Symbol(c, Decl(functionConstraintSatisfaction3.ts, 15, 3))
|
|
|
|
interface I2<T> {
|
|
>I2 : Symbol(I2, Decl(functionConstraintSatisfaction3.ts, 22, 16))
|
|
>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 24, 13))
|
|
|
|
(x: T): T;
|
|
>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 25, 5))
|
|
>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 24, 13))
|
|
>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 24, 13))
|
|
}
|
|
var i2: I2<string>;
|
|
>i2 : Symbol(i2, Decl(functionConstraintSatisfaction3.ts, 27, 3))
|
|
>I2 : Symbol(I2, Decl(functionConstraintSatisfaction3.ts, 22, 16))
|
|
|
|
class C2<T> {
|
|
>C2 : Symbol(C2, Decl(functionConstraintSatisfaction3.ts, 27, 19))
|
|
>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 29, 9))
|
|
|
|
foo: T;
|
|
>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 29, 13))
|
|
>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 29, 9))
|
|
}
|
|
|
|
var a2: { <T>(x: T): T };
|
|
>a2 : Symbol(a2, Decl(functionConstraintSatisfaction3.ts, 33, 3))
|
|
>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 33, 11))
|
|
>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 33, 14))
|
|
>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 33, 11))
|
|
>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 33, 11))
|
|
|
|
var b2: { new <T>(x: T): T };
|
|
>b2 : Symbol(b2, Decl(functionConstraintSatisfaction3.ts, 34, 3))
|
|
>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 34, 15))
|
|
>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 34, 18))
|
|
>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 34, 15))
|
|
>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 34, 15))
|
|
|
|
var c2: { <T>(x: T): T; <T>(x: T, y: T): T };
|
|
>c2 : Symbol(c2, Decl(functionConstraintSatisfaction3.ts, 35, 3))
|
|
>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 35, 11))
|
|
>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 35, 14))
|
|
>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 35, 11))
|
|
>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 35, 11))
|
|
>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 35, 25))
|
|
>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 35, 28))
|
|
>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 35, 25))
|
|
>y : Symbol(y, Decl(functionConstraintSatisfaction3.ts, 35, 33))
|
|
>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 35, 25))
|
|
>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 35, 25))
|
|
|
|
var r9 = foo(function <U>(x: U) { return x; });
|
|
>r9 : Symbol(r9, Decl(functionConstraintSatisfaction3.ts, 37, 3))
|
|
>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 0, 0))
|
|
>U : Symbol(U, Decl(functionConstraintSatisfaction3.ts, 37, 23))
|
|
>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 37, 26))
|
|
>U : Symbol(U, Decl(functionConstraintSatisfaction3.ts, 37, 23))
|
|
>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 37, 26))
|
|
|
|
var r10 = foo(<U extends string>(x: U) => x);
|
|
>r10 : Symbol(r10, Decl(functionConstraintSatisfaction3.ts, 38, 3))
|
|
>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 0, 0))
|
|
>U : Symbol(U, Decl(functionConstraintSatisfaction3.ts, 38, 15))
|
|
>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 38, 33))
|
|
>U : Symbol(U, Decl(functionConstraintSatisfaction3.ts, 38, 15))
|
|
>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 38, 33))
|
|
|
|
var r12 = foo(i2);
|
|
>r12 : Symbol(r12, Decl(functionConstraintSatisfaction3.ts, 39, 3))
|
|
>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 0, 0))
|
|
>i2 : Symbol(i2, Decl(functionConstraintSatisfaction3.ts, 27, 3))
|
|
|
|
var r15 = foo(c2);
|
|
>r15 : Symbol(r15, Decl(functionConstraintSatisfaction3.ts, 40, 3))
|
|
>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 0, 0))
|
|
>c2 : Symbol(c2, Decl(functionConstraintSatisfaction3.ts, 35, 3))
|
|
|