TypeScript/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt

31 lines
2.2 KiB
Plaintext

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; }'.
Type '{}' is not assignable to type '{ a: number; b: number; }'.
Property 'a' is missing in type '{}'.
tests/cases/compiler/overloadsWithProvisionalErrors.ts(7,17): error TS2304: Cannot find name 'blah'.
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; }'.
Type '{ a: any; }' is not assignable to type '{ a: number; b: number; }'.
Property 'b' is missing in type '{ a: any; }'.
tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,17): error TS2304: Cannot find name 'blah'.
==== 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)
~~~~~~~~~
!!! error TS2345: Argument of type '(s: string) => {}' is not assignable to parameter of type '(s: string) => { a: number; b: number; }'.
!!! error TS2345: Type '{}' is not assignable to type '{ a: number; b: number; }'.
!!! error TS2345: Property 'a' is missing in type '{}'.
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)
~~~~
!!! error TS2304: Cannot find name 'blah'.
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
~~~~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(s: string) => { a: any; }' is not assignable to parameter of type '(s: string) => { a: number; b: number; }'.
!!! error TS2345: Type '{ a: any; }' is not assignable to type '{ a: number; b: number; }'.
!!! error TS2345: Property 'b' is missing in type '{ a: any; }'.
~~~~
!!! error TS2304: Cannot find name 'blah'.