TypeScript/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt
2014-07-24 19:39:50 -07:00

17 lines
1,019 B
Plaintext

==== 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)
~~~~~~~~~
!!! Argument of type '(s: string) => {}' is not assignable to parameter of type '(s: string) => { a: number; b: number; }'.
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)
~~~~
!!! 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
~~~~~~~~~~~~~~~~~~
!!! Argument of type '(s: string) => { a: unknown; }' is not assignable to parameter of type '(s: string) => { a: number; b: number; }'.
~~~~
!!! Cannot find name 'blah'.