diff --git a/tests/baselines/reference/contextualTypingWithGenericSignature.types b/tests/baselines/reference/contextualTypingWithGenericSignature.types index 68c5f3c422d..e662f2c4192 100644 --- a/tests/baselines/reference/contextualTypingWithGenericSignature.types +++ b/tests/baselines/reference/contextualTypingWithGenericSignature.types @@ -16,10 +16,10 @@ var f2: { }; f2 = (x, y) => { return x } ->f2 = (x, y) => { return x } : (x: any, y: any) => any +>f2 = (x, y) => { return x } : (x: T, y: U) => T >f2 : (x: T, y: U) => T ->(x, y) => { return x } : (x: any, y: any) => any ->x : any ->y : any ->x : any +>(x, y) => { return x } : (x: T, y: U) => T +>x : T +>y : U +>x : T diff --git a/tests/baselines/reference/genericFunctionHasFreshTypeArgs.types b/tests/baselines/reference/genericFunctionHasFreshTypeArgs.types index 3a3afebb9ac..d6f64bdc933 100644 --- a/tests/baselines/reference/genericFunctionHasFreshTypeArgs.types +++ b/tests/baselines/reference/genericFunctionHasFreshTypeArgs.types @@ -9,13 +9,13 @@ function f(p: (x: T) => void) { }; f(x => f(y => x = y)); >f(x => f(y => x = y)) : void >f : (p: (x: T) => void) => void ->x => f(y => x = y) : (x: any) => void ->x : any +>x => f(y => x = y) : (x: T) => void +>x : T >f(y => x = y) : void >f : (p: (x: T) => void) => void ->y => x = y : (y: any) => any ->y : any ->x = y : any ->x : any ->y : any +>y => x = y : (y: T) => T +>y : T +>x = y : T +>x : T +>y : T diff --git a/tests/baselines/reference/genericTypeAssertions3.types b/tests/baselines/reference/genericTypeAssertions3.types index 9f7facc8d47..e46dd4aaa4e 100644 --- a/tests/baselines/reference/genericTypeAssertions3.types +++ b/tests/baselines/reference/genericTypeAssertions3.types @@ -6,9 +6,9 @@ var r = < (x: T) => T > ((x) => { return null; }); // bug was 'could not find >x : T >T : T >T : T ->((x) => { return null; }) : (x: any) => any ->(x) => { return null; } : (x: any) => any ->x : any +>((x) => { return null; }) : (x: T) => any +>(x) => { return null; } : (x: T) => any +>x : T >null : null var s = < (x: T) => T > ((x: any) => { return null; }); // no error diff --git a/tests/baselines/reference/implicitAnyGenericTypeInference.errors.txt b/tests/baselines/reference/implicitAnyGenericTypeInference.errors.txt deleted file mode 100644 index 0c64c3e6125..00000000000 --- a/tests/baselines/reference/implicitAnyGenericTypeInference.errors.txt +++ /dev/null @@ -1,16 +0,0 @@ -tests/cases/compiler/implicitAnyGenericTypeInference.ts(6,19): error TS7006: Parameter 'x' implicitly has an 'any' type. -tests/cases/compiler/implicitAnyGenericTypeInference.ts(6,22): error TS7006: Parameter 'y' implicitly has an 'any' type. - - -==== tests/cases/compiler/implicitAnyGenericTypeInference.ts (2 errors) ==== - interface Comparer { - compareTo(x: T, y: U): U; - } - - var c: Comparer; - c = { compareTo: (x, y) => { return y; } }; - ~ -!!! error TS7006: Parameter 'x' implicitly has an 'any' type. - ~ -!!! error TS7006: Parameter 'y' implicitly has an 'any' type. - var r = c.compareTo(1, ''); \ No newline at end of file diff --git a/tests/baselines/reference/implicitAnyGenericTypeInference.symbols b/tests/baselines/reference/implicitAnyGenericTypeInference.symbols new file mode 100644 index 00000000000..e56b68a7134 --- /dev/null +++ b/tests/baselines/reference/implicitAnyGenericTypeInference.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/implicitAnyGenericTypeInference.ts === +interface Comparer { +>Comparer : Symbol(Comparer, Decl(implicitAnyGenericTypeInference.ts, 0, 0)) +>T : Symbol(T, Decl(implicitAnyGenericTypeInference.ts, 0, 19)) + + compareTo(x: T, y: U): U; +>compareTo : Symbol(Comparer.compareTo, Decl(implicitAnyGenericTypeInference.ts, 0, 23)) +>U : Symbol(U, Decl(implicitAnyGenericTypeInference.ts, 1, 14)) +>x : Symbol(x, Decl(implicitAnyGenericTypeInference.ts, 1, 17)) +>T : Symbol(T, Decl(implicitAnyGenericTypeInference.ts, 0, 19)) +>y : Symbol(y, Decl(implicitAnyGenericTypeInference.ts, 1, 22)) +>U : Symbol(U, Decl(implicitAnyGenericTypeInference.ts, 1, 14)) +>U : Symbol(U, Decl(implicitAnyGenericTypeInference.ts, 1, 14)) +} + +var c: Comparer; +>c : Symbol(c, Decl(implicitAnyGenericTypeInference.ts, 4, 3)) +>Comparer : Symbol(Comparer, Decl(implicitAnyGenericTypeInference.ts, 0, 0)) + +c = { compareTo: (x, y) => { return y; } }; +>c : Symbol(c, Decl(implicitAnyGenericTypeInference.ts, 4, 3)) +>compareTo : Symbol(compareTo, Decl(implicitAnyGenericTypeInference.ts, 5, 5)) +>x : Symbol(x, Decl(implicitAnyGenericTypeInference.ts, 5, 18)) +>y : Symbol(y, Decl(implicitAnyGenericTypeInference.ts, 5, 20)) +>y : Symbol(y, Decl(implicitAnyGenericTypeInference.ts, 5, 20)) + +var r = c.compareTo(1, ''); +>r : Symbol(r, Decl(implicitAnyGenericTypeInference.ts, 6, 3)) +>c.compareTo : Symbol(Comparer.compareTo, Decl(implicitAnyGenericTypeInference.ts, 0, 23)) +>c : Symbol(c, Decl(implicitAnyGenericTypeInference.ts, 4, 3)) +>compareTo : Symbol(Comparer.compareTo, Decl(implicitAnyGenericTypeInference.ts, 0, 23)) + diff --git a/tests/baselines/reference/implicitAnyGenericTypeInference.types b/tests/baselines/reference/implicitAnyGenericTypeInference.types new file mode 100644 index 00000000000..4124c729f14 --- /dev/null +++ b/tests/baselines/reference/implicitAnyGenericTypeInference.types @@ -0,0 +1,38 @@ +=== tests/cases/compiler/implicitAnyGenericTypeInference.ts === +interface Comparer { +>Comparer : Comparer +>T : T + + compareTo(x: T, y: U): U; +>compareTo : (x: T, y: U) => U +>U : U +>x : T +>T : T +>y : U +>U : U +>U : U +} + +var c: Comparer; +>c : Comparer +>Comparer : Comparer + +c = { compareTo: (x, y) => { return y; } }; +>c = { compareTo: (x, y) => { return y; } } : { compareTo: (x: any, y: U) => U; } +>c : Comparer +>{ compareTo: (x, y) => { return y; } } : { compareTo: (x: any, y: U) => U; } +>compareTo : (x: any, y: U) => U +>(x, y) => { return y; } : (x: any, y: U) => U +>x : any +>y : U +>y : U + +var r = c.compareTo(1, ''); +>r : string +>c.compareTo(1, '') : "" +>c.compareTo : (x: any, y: U) => U +>c : Comparer +>compareTo : (x: any, y: U) => U +>1 : 1 +>'' : "" +