2014-09-12 22:35:07 +02:00
tests/cases/compiler/overloadsWithProvisionalErrors.ts(6,6): error TS2345: Argument of type '(s: string) => {}' is not assignable to parameter of type '(s: string) => { a: number; b: number; }'.
2015-01-20 23:18:22 +01:00
Type '{}' is not assignable to type '{ a: number; b: number; }'.
2015-03-26 03:23:44 +01:00
Property 'a' is missing in type '{}'.
2014-09-12 22:35:07 +02:00
tests/cases/compiler/overloadsWithProvisionalErrors.ts(7,17): error TS2304: Cannot find name 'blah'.
2014-10-04 00:50:38 +02:00
tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,6): error TS2345: Argument of type '(s: string) => { a: any; }' is not assignable to parameter of type '(s: string) => { a: number; b: number; }'.
2015-01-20 23:18:22 +01:00
Type '{ a: any; }' is not assignable to type '{ a: number; b: number; }'.
2015-03-26 03:23:44 +01:00
Property 'b' is missing in type '{ a: any; }'.
2014-09-12 22:35:07 +02:00
tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,17): error TS2304: Cannot find name 'blah'.
2014-07-13 01:04:16 +02:00
==== tests/cases/compiler/overloadsWithProvisionalErrors.ts (4 errors) ====
var func: {
(s: string): number;
(lambda: (s: string) => { a: number; b: number }): string;
};
func(s => ({})); // Error for no applicable overload (object type is missing a and b)
2014-07-25 02:00:03 +02:00
~~~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2345: Argument of type '(s: string) => {}' is not assignable to parameter of type '(s: string) => { a: number; b: number; }'.
2015-01-20 23:18:22 +01:00
!!! error TS2345: Type '{}' is not assignable to type '{ a: number; b: number; }'.
2015-03-26 03:23:44 +01:00
!!! error TS2345: Property 'a' is missing in type '{}'.
2014-07-13 01:04:16 +02:00
func(s => ({ a: blah, b: 3 })); // Only error inside the function, but not outside (since it would be applicable if not for the provisional error)
~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2304: Cannot find name 'blah'.
2014-07-13 01:04:16 +02:00
func(s => ({ a: blah })); // Two errors here, one for blah not being defined, and one for the overload since it would not be applicable anyway
2014-07-25 02:00:03 +02:00
~~~~~~~~~~~~~~~~~~
2014-10-04 00:50:38 +02:00
!!! error TS2345: Argument of type '(s: string) => { a: any; }' is not assignable to parameter of type '(s: string) => { a: number; b: number; }'.
2015-01-20 23:18:22 +01:00
!!! error TS2345: Type '{ a: any; }' is not assignable to type '{ a: number; b: number; }'.
2015-03-26 03:23:44 +01:00
!!! error TS2345: Property 'b' is missing in type '{ a: any; }'.
2014-07-13 01:04:16 +02:00
~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2304: Cannot find name 'blah'.