Addressing CR feedback.

This commit is contained in:
Anders Hejlsberg 2014-07-24 19:39:50 -07:00
parent a515b199b7
commit 511402cd84
109 changed files with 281 additions and 281 deletions

View File

@ -3743,8 +3743,8 @@ module ts {
checkExpression(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined);
// Use argument expression as error location when reporting errors
var isValidArgument = checkTypeRelatedTo(argType, paramType, relation, reportErrors ? arg : undefined,
Diagnostics.Argument_type_0_is_not_assignable_to_parameter_type_1,
Diagnostics.Argument_type_0_is_not_assignable_to_parameter_type_1);
Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1,
Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1);
if (!isValidArgument) {
return false;
}

View File

@ -190,7 +190,7 @@ module ts {
Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { code: 3033, category: DiagnosticCategory.Error, key: "Specialized overload signature is not assignable to any non-specialized signature." },
Duplicate_function_implementation: { code: 3034, category: DiagnosticCategory.Error, key: "Duplicate function implementation." },
Overload_signature_is_not_compatible_with_function_implementation: { code: 3035, category: DiagnosticCategory.Error, key: "Overload signature is not compatible with function implementation." },
Argument_type_0_is_not_assignable_to_parameter_type_1: { code: 3036, category: DiagnosticCategory.Error, key: "Argument type '{0}' is not assignable to parameter type '{1}'." },
Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 3036, category: DiagnosticCategory.Error, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." },
Index_signature_is_missing_in_type_0: { code: 4003, category: DiagnosticCategory.Error, key: "Index signature is missing in type '{0}'." },
Index_signatures_are_incompatible_Colon: { code: 4004, category: DiagnosticCategory.Error, key: "Index signatures are incompatible:" },
Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 4016, category: DiagnosticCategory.NoPrefix, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." },

View File

@ -753,7 +753,7 @@
"category": "Error",
"code": 3035
},
"Argument type '{0}' is not assignable to parameter type '{1}'.": {
"Argument of type '{0}' is not assignable to parameter of type '{1}'.": {
"category": "Error",
"code": 3036
},

View File

@ -12,6 +12,6 @@
var xx = new a(null, 7, new B());
~~~~~~~
!!! Argument type 'B' is not assignable to parameter type 'B[]'.
!!! Argument of type 'B' is not assignable to parameter of type 'B[]'.

View File

@ -28,8 +28,8 @@
var arr = [new Giraffe(), new Elephant()];
foo(arr); // Error because of no contextual type
~~~
!!! Argument type '{}[]' is not assignable to parameter type 'IAnimal[]'.
!!! Argument of type '{}[]' is not assignable to parameter of type 'IAnimal[]'.
!!! Type '{}' is not assignable to type 'IAnimal'.
bar(arr); // Error because of no contextual type
~~~
!!! Argument type '{}[]' is not assignable to parameter type '{ [x: number]: IAnimal; }'.
!!! Argument of type '{}[]' is not assignable to parameter of type '{ [x: number]: IAnimal; }'.

View File

@ -7,10 +7,10 @@
fn((a, b) => true);
~~~~~~~~~~~~~~
!!! Argument type '(a: any, b: any) => boolean' is not assignable to parameter type 'IResultCallback'.
!!! Argument of type '(a: any, b: any) => boolean' is not assignable to parameter of type 'IResultCallback'.
!!! Property 'x' is missing in type '(a: any, b: any) => boolean'.
fn(function (a, b) { return true; })
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Argument type '(a: any, b: any) => boolean' is not assignable to parameter type 'IResultCallback'.
!!! Argument of type '(a: any, b: any) => boolean' is not assignable to parameter of type 'IResultCallback'.
!!! Property 'x' is missing in type '(a: any, b: any) => boolean'.

View File

@ -2,21 +2,21 @@
function foo1(x: { a: number; }) { }
foo1({ b: 5 });
~~~~~~~~
!!! Argument type '{ b: number; }' is not assignable to parameter type '{ a: number; }'.
!!! Argument of type '{ b: number; }' is not assignable to parameter of type '{ a: number; }'.
!!! Property 'a' is missing in type '{ b: number; }'.
function foo2(x: number[]) { }
foo2(["s", "t"]);
~~~~~~~~~~
!!! Argument type 'string[]' is not assignable to parameter type 'number[]'.
!!! Argument of type 'string[]' is not assignable to parameter of type 'number[]'.
!!! Type 'string' is not assignable to type 'number'.
function foo3(x: (n: number) =>number) { };
foo3((s:string) => { });
~~~~~~~~~~~~~~~~~
!!! Argument type '(s: string) => void' is not assignable to parameter type '(n: number) => number'.
!!! Argument of type '(s: string) => void' is not assignable to parameter of type '(n: number) => number'.
foo3((n) => { return; });
~~~~~~~~~~~~~~~~~~
!!! Argument type '(n: number) => void' is not assignable to parameter type '(n: number) => number'.
!!! Argument of type '(n: number) => void' is not assignable to parameter of type '(n: number) => number'.

View File

@ -6,10 +6,10 @@
foo({ id: 1234, name: "hello" }); // Ok
foo({ id: 1234, name: false }); // Error, name of wrong type
~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Argument type '{ id: number; name: boolean; }' is not assignable to parameter type '{ id: number; name?: string; }'.
!!! Argument of type '{ id: number; name: boolean; }' is not assignable to parameter of type '{ id: number; name?: string; }'.
!!! Types of property 'name' are incompatible:
!!! Type 'boolean' is not assignable to type 'string'.
foo({ name: "hello" }); // Error, id required but missing
~~~~~~~~~~~~~~~~~
!!! Argument type '{ name: string; }' is not assignable to parameter type '{ id: number; name?: string; }'.
!!! Argument of type '{ name: string; }' is not assignable to parameter of type '{ id: number; name?: string; }'.
!!! Property 'id' is missing in type '{ name: string; }'.

View File

@ -15,5 +15,5 @@
Biz(new Foo());
~~~~~~~~~
!!! Argument type 'Foo' is not assignable to parameter type 'IHandlerMap'.
!!! Argument of type 'Foo' is not assignable to parameter of type 'IHandlerMap'.

View File

@ -34,16 +34,16 @@
// Should Fail
fn('');
~~
!!! Argument type 'string' is not assignable to parameter type 'Applicable'.
!!! Argument of type 'string' is not assignable to parameter of type 'Applicable'.
fn(['']);
~~~~
!!! Argument type 'string[]' is not assignable to parameter type 'Applicable'.
!!! Argument of type 'string[]' is not assignable to parameter of type 'Applicable'.
fn(4);
~
!!! Argument type 'number' is not assignable to parameter type 'Applicable'.
!!! Argument of type 'number' is not assignable to parameter of type 'Applicable'.
fn({});
~~
!!! Argument type '{}' is not assignable to parameter type 'Applicable'.
!!! Argument of type '{}' is not assignable to parameter of type 'Applicable'.
!!! Property 'apply' is missing in type '{}'.

View File

@ -34,16 +34,16 @@
// Should Fail
fn('');
~~
!!! Argument type 'string' is not assignable to parameter type 'Callable'.
!!! Argument of type 'string' is not assignable to parameter of type 'Callable'.
fn(['']);
~~~~
!!! Argument type 'string[]' is not assignable to parameter type 'Callable'.
!!! Argument of type 'string[]' is not assignable to parameter of type 'Callable'.
fn(4);
~
!!! Argument type 'number' is not assignable to parameter type 'Callable'.
!!! Argument of type 'number' is not assignable to parameter of type 'Callable'.
fn({});
~~
!!! Argument type '{}' is not assignable to parameter type 'Callable'.
!!! Argument of type '{}' is not assignable to parameter of type 'Callable'.
!!! Property 'call' is missing in type '{}'.

View File

@ -27,7 +27,7 @@
!!! 'this' cannot be referenced in current location.
class F extends C { constructor(public z: number) { super("hello", this.z) } } // first param type
~~~~~~~
!!! Argument type 'string' is not assignable to parameter type 'number'.
!!! Argument of type 'string' is not assignable to parameter of type 'number'.
~~~~
!!! 'this' cannot be referenced in current location.

View File

@ -9,5 +9,5 @@
test("expects boolean instead of string"); // should not error - "test" should not expect a boolean
test(true); // should error - string expected
~~~~
!!! Argument type 'boolean' is not assignable to parameter type 'string'.
!!! Argument of type 'boolean' is not assignable to parameter of type 'string'.
}

View File

@ -16,5 +16,5 @@
var r = x.foo(1); // no error
var r2 = x.foo(''); // error
~~
!!! Argument type 'string' is not assignable to parameter type 'number'.
!!! Argument of type 'string' is not assignable to parameter of type 'number'.

View File

@ -19,4 +19,4 @@
// Ok to go down the chain, but error to try to climb back up
(new Chain(new A)).then(a => new B).then(b => new C).then(c => new B).then(b => new A);
~~~~~~~~~~
!!! Argument type '(c: C) => B' is not assignable to parameter type '(x: C) => C'.
!!! Argument of type '(c: C) => B' is not assignable to parameter of type '(x: C) => C'.

View File

@ -7,12 +7,12 @@
// Ok to go down the chain, but error to climb up the chain
(new Chain(t)).then(tt => s).then(ss => t);
~~~~~~~
!!! Argument type '(ss: S) => T' is not assignable to parameter type '(x: S) => S'.
!!! Argument of type '(ss: S) => T' is not assignable to parameter of type '(x: S) => S'.
// But error to try to climb up the chain
(new Chain(s)).then(ss => t);
~~~~~~~
!!! Argument type '(ss: S) => T' is not assignable to parameter type '(x: S) => S'.
!!! Argument of type '(ss: S) => T' is not assignable to parameter of type '(x: S) => S'.
// Staying at T or S should be fine
(new Chain(t)).then(tt => t).then(tt => t).then(tt => t);

View File

@ -20,10 +20,10 @@
var f2 = new Foo(0);
var f3 = new Foo(f1);
~~
!!! Argument type 'Foo' is not assignable to parameter type 'number'.
!!! Argument of type 'Foo' is not assignable to parameter of type 'number'.
var f4 = new Foo([f1,f2,f3]);
~~~~~~~~~~
!!! Argument type 'unknown[]' is not assignable to parameter type 'number'.
!!! Argument of type 'unknown[]' is not assignable to parameter of type 'number'.
f1.bar1();
f1.bar2();

View File

@ -1,5 +1,5 @@
==== tests/cases/compiler/contextualTyping30.ts (1 errors) ====
function foo(param:number[]){}; foo([1, "a"]);
~~~~~~~~
!!! Argument type '{}[]' is not assignable to parameter type 'number[]'.
!!! Argument of type '{}[]' is not assignable to parameter of type 'number[]'.
!!! Type '{}' is not assignable to type 'number'.

View File

@ -1,5 +1,5 @@
==== tests/cases/compiler/contextualTyping33.ts (1 errors) ====
function foo(param: {():number; (i:number):number; }[]) { }; foo([function(){return 1;}, function(){return "foo"}]);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Argument type '{}[]' is not assignable to parameter type '{ (): number; (i: number): number; }[]'.
!!! Argument of type '{}[]' is not assignable to parameter of type '{ (): number; (i: number): number; }[]'.
!!! Type '{}' is not assignable to type '{ (): number; (i: number): number; }'.

View File

@ -16,8 +16,8 @@
var f = (x: number) => { return x.toFixed() };
var r5 = _.forEach<number>(c2, f);
~
!!! Argument type '(x: number) => string' is not assignable to parameter type '(x: number) => Date'.
!!! Argument of type '(x: number) => string' is not assignable to parameter of type '(x: number) => Date'.
var r6 = _.forEach<number>(c2, (x) => { return x.toFixed() });
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Argument type '(x: number) => string' is not assignable to parameter type '(x: number) => Date'.
!!! Argument of type '(x: number) => string' is not assignable to parameter of type '(x: number) => Date'.

View File

@ -13,4 +13,4 @@
f(obj1); // Ok
f(obj2); // Error - indexer doesn't match
~~~~
!!! Argument type '{ x: string; }' is not assignable to parameter type '{ [x: string]: string; }'.
!!! Argument of type '{ x: string; }' is not assignable to parameter of type '{ [x: string]: string; }'.

View File

@ -4,7 +4,7 @@
n = f();
var s: string = f('');
~~
!!! Argument type 'string' is not assignable to parameter type 'number'.
!!! Argument of type 'string' is not assignable to parameter of type 'number'.
s = f();
~
!!! Type 'number' is not assignable to type 'string'.

View File

@ -2,7 +2,7 @@
import foo = require("./foo_0");
var x = new foo(true); // Should error
~~~~
!!! Argument type 'boolean' is not assignable to parameter type '{ a: string; b: number; }'.
!!! Argument of type 'boolean' is not assignable to parameter of type '{ a: string; b: number; }'.
var y = new foo({a: "test", b: 42}); // Should be OK
var z: number = y.test.b;
==== tests/cases/conformance/externalModules/foo_0.ts (0 errors) ====

View File

@ -3,9 +3,9 @@
foo(0, 1);
foo('foo');
~~~~~
!!! Argument type 'string' is not assignable to parameter type 'number'.
!!! Argument of type 'string' is not assignable to parameter of type 'number'.
foo();
foo(1, 'bar');
~~~~~
!!! Argument type 'string' is not assignable to parameter type 'number'.
!!! Argument of type 'string' is not assignable to parameter of type 'number'.

View File

@ -7,7 +7,7 @@
!!! Supplied parameters do not match any signature of call target.
foo(1, 'bar');
~
!!! Argument type 'number' is not assignable to parameter type 'string'.
!!! Argument of type 'number' is not assignable to parameter of type 'string'.
foo('foo', 1, 'bar');
~~~~~~~~~~~~~~~~~~~~
!!! Supplied parameters do not match any signature of call target.

View File

@ -7,9 +7,9 @@
!!! Supplied parameters do not match any signature of call target.
foo(1, 'bar');
~
!!! Argument type 'number' is not assignable to parameter type 'string'.
!!! Argument of type 'number' is not assignable to parameter of type 'string'.
foo('foo', 1, 'bar');
foo('foo', 1, 3);
~
!!! Argument type 'number' is not assignable to parameter type 'string'.
!!! Argument of type 'number' is not assignable to parameter of type 'string'.

View File

@ -7,6 +7,6 @@
!!! Supplied parameters do not match any signature of call target.
foo(1, 'bar');
~
!!! Argument type 'number' is not assignable to parameter type 'string'.
!!! Argument of type 'number' is not assignable to parameter of type 'string'.
foo('foo', 1, 3);

View File

@ -5,6 +5,6 @@
foo();
foo(1, 'bar');
~
!!! Argument type 'number' is not assignable to parameter type 'string'.
!!! Argument of type 'number' is not assignable to parameter of type 'string'.
foo('foo', 1, 3);

View File

@ -2,7 +2,7 @@
function foo(a:string, b?:string, ...c:number[]){}
foo('foo', 1);
~
!!! Argument type 'number' is not assignable to parameter type 'string'.
!!! Argument of type 'number' is not assignable to parameter of type 'string'.
foo('foo');
foo('foo', 'bar');
foo();
@ -10,6 +10,6 @@
!!! Supplied parameters do not match any signature of call target.
foo(1, 'bar');
~
!!! Argument type 'number' is not assignable to parameter type 'string'.
!!! Argument of type 'number' is not assignable to parameter of type 'string'.
foo('foo', 'bar', 3);

View File

@ -2,16 +2,16 @@
function foo(a:string, b?:string, c?:number, ...d:number[]){}
foo('foo', 1);
~
!!! Argument type 'number' is not assignable to parameter type 'string'.
!!! Argument of type 'number' is not assignable to parameter of type 'string'.
foo('foo');
foo();
~~~~~
!!! Supplied parameters do not match any signature of call target.
foo(1, 'bar');
~
!!! Argument type 'number' is not assignable to parameter type 'string'.
!!! Argument of type 'number' is not assignable to parameter of type 'string'.
foo('foo', 1, 3);
~
!!! Argument type 'number' is not assignable to parameter type 'string'.
!!! Argument of type 'number' is not assignable to parameter of type 'string'.
foo('foo', 'bar', 3, 4);

View File

@ -3,7 +3,7 @@
foo('bar');
foo(2);
~
!!! Argument type 'number' is not assignable to parameter type 'string'.
!!! Argument of type 'number' is not assignable to parameter of type 'string'.
foo('foo', 'bar');
~~~~~~~~~~~~~~~~~
!!! Supplied parameters do not match any signature of call target.

View File

@ -8,7 +8,7 @@
!!! Supplied parameters do not match any signature of call target.
foo(4);
~
!!! Argument type 'number' is not assignable to parameter type 'c1'.
!!! Argument of type 'number' is not assignable to parameter of type 'c1'.
foo();
~~~~~
!!! Supplied parameters do not match any signature of call target.

View File

@ -6,6 +6,6 @@
!!! Supplied parameters do not match any signature of call target.
foo(4);
~
!!! Argument type 'number' is not assignable to parameter type 'string'.
!!! Argument of type 'number' is not assignable to parameter of type 'string'.
foo();

View File

@ -4,7 +4,7 @@
foo('foo');
foo('foo','bar');
~~~~~
!!! Argument type 'string' is not assignable to parameter type 'number'.
!!! Argument of type 'string' is not assignable to parameter of type 'number'.
foo('foo', 1, 'bar');
~~~~~~~~~~~~~~~~~~~~
!!! Supplied parameters do not match any signature of call target.

View File

@ -5,7 +5,7 @@
foo(1);
~
!!! Argument type 'number' is not assignable to parameter type 'Function'.
!!! Argument of type 'number' is not assignable to parameter of type 'Function'.
foo(() => { }, 1);
~~~~~~~~~~~~~~~~~
!!! Supplied parameters do not match any signature of call target.
@ -29,41 +29,41 @@
var r = foo2(new Function());
~~~~~~~~~~~~~~
!!! Argument type 'Function' is not assignable to parameter type '(x: string) => string'.
!!! Argument of type 'Function' is not assignable to parameter of type '(x: string) => string'.
var r2 = foo2((x: string[]) => x);
~~~~~~~~~~~~~~~~~~
!!! Argument type '(x: string[]) => string[]' is not assignable to parameter type '(x: string) => string'.
!!! Argument of type '(x: string[]) => string[]' is not assignable to parameter of type '(x: string) => string'.
var r6 = foo2(C);
~
!!! Argument type 'typeof C' is not assignable to parameter type '(x: string) => string'.
!!! Argument of type 'typeof C' is not assignable to parameter of type '(x: string) => string'.
var r7 = foo2(b);
~
!!! Argument type 'new (x: string) => string' is not assignable to parameter type '(x: string) => string'.
!!! Argument of type 'new (x: string) => string' is not assignable to parameter of type '(x: string) => string'.
var r8 = foo2(<U>(x: U) => x); // no error expected
var r11 = foo2(<U, V>(x: U, y: V) => x);
~~~~~~~~~~~~~~~~~~~~~~~
!!! Argument type '<U, V>(x: U, y: V) => U' is not assignable to parameter type '(x: string) => string'.
!!! Argument of type '<U, V>(x: U, y: V) => U' is not assignable to parameter of type '(x: string) => string'.
var r13 = foo2(C2);
~~
!!! Argument type 'typeof C2' is not assignable to parameter type '(x: string) => string'.
!!! Argument of type 'typeof C2' is not assignable to parameter of type '(x: string) => string'.
var r14 = foo2(b2);
~~
!!! Argument type 'new <T>(x: T) => T' is not assignable to parameter type '(x: string) => string'.
!!! Argument of type 'new <T>(x: T) => T' is not assignable to parameter of type '(x: string) => string'.
interface F2 extends Function { foo: string; }
var f2: F2;
var r16 = foo2(f2);
~~
!!! Argument type 'F2' is not assignable to parameter type '(x: string) => string'.
!!! Argument of type 'F2' is not assignable to parameter of type '(x: string) => string'.
function fff<T extends { (): void }, U extends T>(x: T, y: U) {
~~~~~~~~~~~
!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
foo2(x);
~
!!! Argument type 'T' is not assignable to parameter type '(x: string) => string'.
!!! Argument of type 'T' is not assignable to parameter of type '(x: string) => string'.
foo2(y);
~
!!! Argument type 'U' is not assignable to parameter type '(x: string) => string'.
!!! Argument of type 'U' is not assignable to parameter of type '(x: string) => string'.
}

View File

@ -4,4 +4,4 @@
function foo(bar?: string): any { return "" };
var x = foo(5);
~
!!! Argument type 'number' is not assignable to parameter type 'string'.
!!! Argument of type 'number' is not assignable to parameter of type 'string'.

View File

@ -4,4 +4,4 @@
function foo(bar: any): any { return bar };
var x = foo(true);
~~~~
!!! Argument type 'boolean' is not assignable to parameter type 'number'.
!!! Argument of type 'boolean' is not assignable to parameter of type 'number'.

View File

@ -4,5 +4,5 @@
function foo(bar?:any):any{ return '' }
var x = foo(5);
~
!!! Argument type 'number' is not assignable to parameter type 'string'.
!!! Argument of type 'number' is not assignable to parameter of type 'string'.

View File

@ -4,7 +4,7 @@
function foo(bar:{a:any;}[]):any{ return bar }
var x = foo([{a:'bar'}]);
~~~~~~~~~~~
!!! Argument type '{ a: string; }[]' is not assignable to parameter type '{ a: boolean; }[]'.
!!! Argument of type '{ a: string; }[]' is not assignable to parameter of type '{ a: boolean; }[]'.
!!! Type '{ a: string; }' is not assignable to type '{ a: boolean; }':
!!! Types of property 'a' are incompatible:
!!! Type 'string' is not assignable to type 'boolean'.

View File

@ -4,7 +4,7 @@
function foo(bar:{a:any;}[]):any{ return bar }
var x = foo([{}]);
~~~~
!!! Argument type '{}[]' is not assignable to parameter type '{ a: boolean; }[]'.
!!! Argument of type '{}[]' is not assignable to parameter of type '{ a: boolean; }[]'.
!!! Type '{}' is not assignable to type '{ a: boolean; }':
!!! Property 'a' is missing in type '{}'.

View File

@ -13,5 +13,5 @@
var r3 = foo(new Object()); // {}
var r4 = foo<Date, Date>(1); // error
~
!!! Argument type 'number' is not assignable to parameter type 'Date'.
!!! Argument of type 'number' is not assignable to parameter of type 'Date'.
var r5 = foo<Date, Date>(new Date()); // no error

View File

@ -11,11 +11,11 @@
var arg2: { cb: new <T>(x: T, y: T) => string };
var r2 = foo(arg2); // error
~~~~
!!! Argument type '{ cb: new <T>(x: T, y: T) => string; }' is not assignable to parameter type '{ cb: new (t: any) => string; }'.
!!! Argument of type '{ cb: new <T>(x: T, y: T) => string; }' is not assignable to parameter of type '{ cb: new (t: any) => string; }'.
var arg3: { cb: new (x: string, y: number) => string };
var r3 = foo(arg3); // error
~~~~
!!! Argument type '{ cb: new (x: string, y: number) => string; }' is not assignable to parameter type '{ cb: new (t: string) => string; }'.
!!! Argument of type '{ cb: new (x: string, y: number) => string; }' is not assignable to parameter of type '{ cb: new (t: string) => string; }'.
function foo2<T, U>(arg: { cb: new(t: T, t2: T) => U }) {
return new arg.cb(null, null);

View File

@ -10,12 +10,12 @@
// more args not allowed
var r2 = foo({ cb: <T>(x: T, y: T) => '' }); // error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Argument type '{ cb: <T>(x: T, y: T) => string; }' is not assignable to parameter type '{ cb: (t: any) => string; }'.
!!! Argument of type '{ cb: <T>(x: T, y: T) => string; }' is not assignable to parameter of type '{ cb: (t: any) => string; }'.
!!! Types of property 'cb' are incompatible:
!!! Type '<T>(x: T, y: T) => string' is not assignable to type '(t: any) => string'.
var r3 = foo({ cb: (x: string, y: number) => '' }); // error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Argument type '{ cb: (x: string, y: number) => string; }' is not assignable to parameter type '{ cb: (t: string) => string; }'.
!!! Argument of type '{ cb: (x: string, y: number) => string; }' is not assignable to parameter of type '{ cb: (t: string) => string; }'.
!!! Types of property 'cb' are incompatible:
!!! Type '(x: string, y: number) => string' is not assignable to type '(t: string) => string'.

View File

@ -14,10 +14,10 @@
// BUG 835518
var r9 = r7(new Date()); // should be ok
~~~~~~~~~~
!!! Argument type 'Date' is not assignable to parameter type 'T'.
!!! Argument of type 'Date' is not assignable to parameter of type 'T'.
var r10 = r7(1); // error
~
!!! Argument type 'number' is not assignable to parameter type 'T'.
!!! Argument of type 'number' is not assignable to parameter of type 'T'.
}
function foo2<T extends Date>(a: (x: T) => T, b: (x: T) => T) {
@ -28,7 +28,7 @@
function other3<T extends RegExp>(x: T) {
var r7 = foo2((a: T) => a, (b: T) => b); // error
~~~~~~~~~~~
!!! Argument type '(a: T) => T' is not assignable to parameter type '(x: Date) => Date'.
!!! Argument of type '(a: T) => T' is not assignable to parameter of type '(x: Date) => Date'.
var r7b = foo2((a) => a, (b) => b); // valid, T is inferred to be Date
}
@ -42,4 +42,4 @@
var r7 = foo3(E.A, (x) => E.A, (x) => F.A); // error
~~~~~~~~~~
!!! Argument type '(x: E) => F' is not assignable to parameter type '(x: E) => E'.
!!! Argument of type '(x: E) => F' is not assignable to parameter of type '(x: E) => E'.

View File

@ -4,21 +4,21 @@
// these are all errors
var x2 = foo<number>({ x: 3, y: "" }, 4);
~~~~~~~~~~~~~~~
!!! Argument type '{ x: number; y: string; }' is not assignable to parameter type '{ x: number; y: number; }'.
!!! Argument of type '{ x: number; y: string; }' is not assignable to parameter of type '{ x: number; y: number; }'.
!!! Types of property 'y' are incompatible:
!!! Type 'string' is not assignable to type 'number'.
var x3 = foo<string>({ x: 3, y: "" }, 4);
~~~~~~~~~~~~~~~
!!! Argument type '{ x: number; y: string; }' is not assignable to parameter type '{ x: string; y: string; }'.
!!! Argument of type '{ x: number; y: string; }' is not assignable to parameter of type '{ x: string; y: string; }'.
!!! Types of property 'x' are incompatible:
!!! Type 'number' is not assignable to type 'string'.
var x4 = foo<number>({ x: "", y: 4 }, "");
~~~~~~~~~~~~~~~
!!! Argument type '{ x: string; y: number; }' is not assignable to parameter type '{ x: number; y: number; }'.
!!! Argument of type '{ x: string; y: number; }' is not assignable to parameter of type '{ x: number; y: number; }'.
!!! Types of property 'x' are incompatible:
!!! Type 'string' is not assignable to type 'number'.
var x5 = foo<string>({ x: "", y: 4 }, "");
~~~~~~~~~~~~~~~
!!! Argument type '{ x: string; y: number; }' is not assignable to parameter type '{ x: string; y: string; }'.
!!! Argument of type '{ x: string; y: number; }' is not assignable to parameter of type '{ x: string; y: string; }'.
!!! Types of property 'y' are incompatible:
!!! Type 'number' is not assignable to type 'string'.

View File

@ -34,7 +34,7 @@
var r4 = foo(c, d);
var r5 = foo<T, U>(c, d); // error
~
!!! Argument type 'C' is not assignable to parameter type 'T'.
!!! Argument of type 'C' is not assignable to parameter of type 'T'.
}

View File

@ -26,6 +26,6 @@
!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
var r5 = foo<T, U>(c, d); // error
~
!!! Argument type 'C' is not assignable to parameter type 'T'.
!!! Argument of type 'C' is not assignable to parameter of type 'T'.
}

View File

@ -31,7 +31,7 @@
var b: { new <T>(x: T, y: T): string };
var r10 = foo6(b); // error
~
!!! Argument type 'new <T>(x: T, y: T) => string' is not assignable to parameter type '{ new (x: any): string; new (x: any, y?: any): string; }'.
!!! Argument of type 'new <T>(x: T, y: T) => string' is not assignable to parameter of type '{ new (x: any): string; new (x: any, y?: any): string; }'.
function foo7<T>(x:T, cb: { new(x: T): string; new(x: T, y?: T): string }) {
return cb;

View File

@ -28,7 +28,7 @@
var r10 = foo6(<T>(x: T, y: T) => ''); // error
~~~~~~~~~~~~~~~~~~~~~
!!! Argument type '<T>(x: T, y: T) => string' is not assignable to parameter type '{ (x: any): string; (x: any, y?: any): string; }'.
!!! Argument of type '<T>(x: T, y: T) => string' is not assignable to parameter of type '{ (x: any): string; (x: any, y?: any): string; }'.
function foo7<T>(x:T, cb: { (x: T): string; (x: T, y?: T): string }) {
return cb;

View File

@ -5,7 +5,7 @@
!!! Supplied parameters do not match any signature of call target.
var r2 = f(1);
~
!!! Argument type 'number' is not assignable to parameter type 'T'.
!!! Argument of type 'number' is not assignable to parameter of type 'T'.
var r3 = f<any>(null);
~~~~~~~~~~~~
!!! Supplied parameters do not match any signature of call target.
@ -22,7 +22,7 @@
var r12 = f(y);
~
!!! Argument type 'U' is not assignable to parameter type 'T'.
!!! Argument of type 'U' is not assignable to parameter of type 'T'.
var r22 = f<number>(y);
~~~~~~~~~~~~
!!! Supplied parameters do not match any signature of call target.

View File

@ -15,7 +15,7 @@
var rf1 = (x: number, y: string) => { return x.toFixed() };
var r5a = _.map<number, string, Date>(c2, (x, y) => { return x.toFixed() });
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Argument type '(x: number, y: string) => string' is not assignable to parameter type '(x: number, y: string) => Date'.
!!! Argument of type '(x: number, y: string) => string' is not assignable to parameter of type '(x: number, y: string) => Date'.
var r5b = _.map<number, string, Date>(c2, rf1);
~~~
!!! Argument type '(x: number, y: string) => string' is not assignable to parameter type '(x: number, y: string) => Date'.
!!! Argument of type '(x: number, y: string) => string' is not assignable to parameter of type '(x: number, y: string) => Date'.

View File

@ -6,7 +6,7 @@
var x: I<{s: string}>
x.f({s: 1})
~~~~~~
!!! Argument type '{ s: number; }' is not assignable to parameter type '{ s: string; }'.
!!! Argument of type '{ s: number; }' is not assignable to parameter of type '{ s: string; }'.
!!! Types of property 's' are incompatible:
!!! Type 'number' is not assignable to type 'string'.

View File

@ -2,7 +2,7 @@
function createInstance<T>(ctor: new (s: string) => T): T {
return new ctor(42); //should be an error
~~
!!! Argument type 'number' is not assignable to parameter type 'string'.
!!! Argument of type 'number' is not assignable to parameter of type 'string'.
}
interface INewable<T> {
@ -12,5 +12,5 @@
function createInstance2<T>(ctor: INewable<T>): T {
return new ctor(1024); //should be an error
~~~~
!!! Argument type 'number' is not assignable to parameter type 'string'.
!!! Argument of type 'number' is not assignable to parameter of type 'string'.
}

View File

@ -5,7 +5,7 @@
var a1Gc = makeArrayG<Object>(1, "");
var a1Gd = makeArrayG<number>(1, ""); // error
~~
!!! Argument type 'string' is not assignable to parameter type 'number'.
!!! Argument of type 'string' is not assignable to parameter of type 'number'.
function makeArrayGOpt<T>(item1?: T, item2?: T, item3?: T) {
return [item1, item2, item3];
@ -14,4 +14,4 @@
var a2Gb = makeArrayG<any>(1, "");
var a2Gc = makeArrayG<any[]>(1, ""); // error
~
!!! Argument type 'number' is not assignable to parameter type 'any[]'.
!!! Argument of type 'number' is not assignable to parameter of type 'any[]'.

View File

@ -7,7 +7,7 @@
x.foo(1); // no error
var f = <T>(x: B<T>) => { return x.foo(1); } // error
~
!!! Argument type 'number' is not assignable to parameter type 'T'.
!!! Argument of type 'number' is not assignable to parameter of type 'T'.
var f2 = <T>(x: B<T>) => { return x.foo<T>(1); } // error
~~~~~~~~~~~
!!! Supplied parameters do not match any signature of call target.

View File

@ -9,7 +9,7 @@
this.test([]);
this.test([1, 2, "hi", 5]); // Error
~~~~~~~~~~~~~~~
!!! Argument type '{}[]' is not assignable to parameter type 'string[]'.
!!! Argument of type '{}[]' is not assignable to parameter of type 'string[]'.
!!! Type '{}' is not assignable to type 'string'.
}
}

View File

@ -62,7 +62,7 @@
var c2: C2;
if1(c1);
~~
!!! Argument type 'C1' is not assignable to parameter type 'IFoo2'.
!!! Argument of type 'C1' is not assignable to parameter of type 'IFoo2'.
function of1(n: { a: { a: string; }; b: string; }): number;
@ -71,7 +71,7 @@
of1({ e: 0, f: 0 });
~~~~~~~~~~~~~~
!!! Argument type '{ e: number; f: number; }' is not assignable to parameter type '{ c: { b: string; }; d: string; }'.
!!! Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ c: { b: string; }; d: string; }'.
!!! Property 'c' is missing in type '{ e: number; f: number; }'.
interface IMap {

View File

@ -18,6 +18,6 @@
var v1 = numberMapToArray(stringMap); // Ok
var v1 = stringMapToArray(numberMap); // Error expected here
~~~~~~~~~
!!! Argument type 'NumberMap<Function>' is not assignable to parameter type 'StringMap<{}>'.
!!! Argument of type 'NumberMap<Function>' is not assignable to parameter of type 'StringMap<{}>'.
var v1 = stringMapToArray(stringMap); // Ok

View File

@ -13,7 +13,7 @@
// Errors
new Derived("", 3);
~
!!! Argument type 'number' is not assignable to parameter type 'string'.
!!! Argument of type 'number' is not assignable to parameter of type 'string'.
new Derived(3);
~
!!! Argument type 'number' is not assignable to parameter type 'string'.
!!! Argument of type 'number' is not assignable to parameter of type 'string'.

View File

@ -32,10 +32,10 @@
// Errors
new Derived(3);
~
!!! Argument type 'number' is not assignable to parameter type 'string'.
!!! Argument of type 'number' is not assignable to parameter of type 'string'.
new Derived("", 3, "", 3);
~
!!! Argument type 'number' is not assignable to parameter type 'string'.
!!! Argument of type 'number' is not assignable to parameter of type 'string'.
new Derived("", 3, "", "");
~
!!! Argument type 'number' is not assignable to parameter type 'string'.
!!! Argument of type 'number' is not assignable to parameter of type 'string'.

View File

@ -32,7 +32,7 @@
x=x.sort(CompareYeux); // parameter mismatch
~~~~~~~~~~~
!!! Argument type '(a: IFrenchEye, b: IFrenchEye) => number' is not assignable to parameter type '(a: IEye, b: IEye) => number'.
!!! Argument of type '(a: IFrenchEye, b: IFrenchEye) => number' is not assignable to parameter of type '(a: IEye, b: IEye) => number'.
// type of z inferred from specialized array type
var z=x.sort(CompareEyes); // ok

View File

@ -3,5 +3,5 @@
}
function foo3(x = foo1(123)) { //should error, 123 is not string
~~~
!!! Argument type 'number' is not assignable to parameter type 'string'.
!!! Argument of type 'number' is not assignable to parameter of type 'string'.
}

View File

@ -31,7 +31,7 @@
super.add(listener);
~~~~~~~~
!!! Argument type '(items: unknown) => void' is not assignable to parameter type '() => any'.
!!! Argument of type '(items: unknown) => void' is not assignable to parameter of type '() => any'.
}

View File

@ -22,7 +22,7 @@
!!! Duplicate identifier 'thunk'.
});
~
!!! Argument type '{ thunk: (num: number) => void; }' is not assignable to parameter type 'Thing'.
!!! Argument of type '{ thunk: (num: number) => void; }' is not assignable to parameter of type 'Thing'.
!!! Types of property 'thunk' are incompatible:
!!! Type '(num: number) => void' is not assignable to type '(str: string) => void':
!!! Types of parameters 'num' and 'str' are incompatible:

View File

@ -10,4 +10,4 @@
var max2: Comparer = (x, y) => { return (x.compareTo(y) > 0) ? x : y };
var maxResult = max2(1, 2);
~
!!! Argument type 'number' is not assignable to parameter type 'Comparable<unknown>'.
!!! Argument of type 'number' is not assignable to parameter of type 'Comparable<unknown>'.

View File

@ -10,7 +10,7 @@
var r6 = map<Object, Object>([1, ""], (x) => x.toString());
var r7 = map<number, string>([1, ""], (x) => x.toString()); // error
~~~~~~~
!!! Argument type '{}[]' is not assignable to parameter type 'number[]'.
!!! Argument of type '{}[]' is not assignable to parameter of type 'number[]'.
!!! Type '{}' is not assignable to type 'number'.
var r7b = map<number>([1, ""], (x) => x.toString()); // error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -4,10 +4,10 @@
}
var one = new Bar({}); // Error
~~
!!! Argument type '{}' is not assignable to parameter type 'string'.
!!! Argument of type '{}' is not assignable to parameter of type 'string'.
[].forEach(() => {
var two = new Bar({}); // No error?
~~
!!! Argument type '{}' is not assignable to parameter type 'string'.
!!! Argument of type '{}' is not assignable to parameter of type 'string'.
});

View File

@ -11,6 +11,6 @@
f1(3);
f2(3); // error no coercion to string
~
!!! Argument type 'number' is not assignable to parameter type 'string'.
!!! Argument of type 'number' is not assignable to parameter of type 'string'.
f2(3+""); // ok + operator promotes

View File

@ -5,7 +5,7 @@
}
function foo(x = new A(123)) { //should error, 123 is not string
~~~
!!! Argument type 'number' is not assignable to parameter type 'string'.
!!! Argument of type 'number' is not assignable to parameter of type 'string'.
}}
~
!!! Declaration or statement expected.

View File

@ -5,6 +5,6 @@
process({a:true,b:"y"});
~~~~~~~~~~~~~~
!!! Argument type '{ a: boolean; b: string; }' is not assignable to parameter type '{ a: number; b: string; }'.
!!! Argument of type '{ a: boolean; b: string; }' is not assignable to parameter of type '{ a: number; b: string; }'.
!!! Types of property 'a' are incompatible:
!!! Type 'boolean' is not assignable to type 'number'.

View File

@ -8,17 +8,17 @@
f2({ hello: 1 }) // error
~~~~~~~~~~~~
!!! Argument type '{ hello: number; }' is not assignable to parameter type 'I'.
!!! Argument of type '{ hello: number; }' is not assignable to parameter of type 'I'.
!!! Property 'value' is missing in type '{ hello: number; }'.
f2({ value: '' }) // missing toString satisfied by Object's member
f2({ value: '', what: 1 }) // missing toString satisfied by Object's member
f2({ toString: (s) => s }) // error, missing property value from ArgsString
~~~~~~~~~~~~~~~~~~~~~~
!!! Argument type '{ toString: (s: string) => string; }' is not assignable to parameter type 'I'.
!!! Argument of type '{ toString: (s: string) => string; }' is not assignable to parameter of type 'I'.
!!! Property 'value' is missing in type '{ toString: (s: string) => string; }'.
f2({ toString: (s: string) => s }) // error, missing property value from ArgsString
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Argument type '{ toString: (s: string) => string; }' is not assignable to parameter type 'I'.
!!! Argument of type '{ toString: (s: string) => string; }' is not assignable to parameter of type 'I'.
!!! Property 'value' is missing in type '{ toString: (s: string) => string; }'.
f2({ value: '', toString: (s) => s.uhhh }) // error
~~~~

View File

@ -8,25 +8,25 @@
f2({ hello: 1 })
~~~~~~~~~~~~
!!! Argument type '{ hello: number; }' is not assignable to parameter type 'I2'.
!!! Argument of type '{ hello: number; }' is not assignable to parameter of type 'I2'.
!!! Property 'value' is missing in type '{ hello: number; }'.
f2({ value: '' })
~~~~~~~~~~~~~
!!! Argument type '{ value: string; }' is not assignable to parameter type 'I2'.
!!! Argument of type '{ value: string; }' is not assignable to parameter of type 'I2'.
!!! Property 'doStuff' is missing in type '{ value: string; }'.
f2({ value: '', what: 1 })
~~~~~~~~~~~~~~~~~~~~~~
!!! Argument type '{ value: string; what: number; }' is not assignable to parameter type 'I2'.
!!! Argument of type '{ value: string; what: number; }' is not assignable to parameter of type 'I2'.
!!! Property 'doStuff' is missing in type '{ value: string; what: number; }'.
f2({ toString: (s) => s })
~~~~~~~~~~~~~~~~~~~~~~
!!! Argument type '{ toString: (s: any) => any; }' is not assignable to parameter type 'I2'.
!!! Argument of type '{ toString: (s: any) => any; }' is not assignable to parameter of type 'I2'.
!!! Property 'value' is missing in type '{ toString: (s: any) => any; }'.
f2({ toString: (s: string) => s })
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Argument type '{ toString: (s: string) => string; }' is not assignable to parameter type 'I2'.
!!! Argument of type '{ toString: (s: string) => string; }' is not assignable to parameter of type 'I2'.
!!! Property 'value' is missing in type '{ toString: (s: string) => string; }'.
f2({ value: '', toString: (s) => s.uhhh })
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Argument type '{ value: string; toString: (s: any) => any; }' is not assignable to parameter type 'I2'.
!!! Argument of type '{ value: string; toString: (s: any) => any; }' is not assignable to parameter of type 'I2'.
!!! Property 'doStuff' is missing in type '{ value: string; toString: (s: any) => any; }'.

View File

@ -44,7 +44,7 @@
!!! Type 'C' is not assignable to type 'string'.
z=x.h(2,2); // no match
~
!!! Argument type 'number' is not assignable to parameter type 'string'.
!!! Argument of type 'number' is not assignable to parameter of type 'string'.
z=x.h("hello",0); // good
var v=x.g;

View File

@ -13,7 +13,7 @@
cb('uh');
cb(1); // error
~
!!! Argument type 'number' is not assignable to parameter type 'string'.
!!! Argument of type 'number' is not assignable to parameter of type 'string'.
}
var cb: (number) => number = (x: number) => 1;

View File

@ -16,7 +16,7 @@
callback(hm);
callback(1); // error
~
!!! Argument type 'number' is not assignable to parameter type 'string'.
!!! Argument of type 'number' is not assignable to parameter of type 'string'.
}
}

View File

@ -17,4 +17,4 @@
foo("HI");
~~~~
!!! Argument type 'string' is not assignable to parameter type '"SPAN"'.
!!! Argument of type 'string' is not assignable to parameter of type '"SPAN"'.

View File

@ -27,7 +27,7 @@
// No candidate overloads found
fn1({}); // Error
~~
!!! Argument type '{}' is not assignable to parameter type 'number'.
!!! Argument of type '{}' is not assignable to parameter of type 'number'.
// Generic and non - generic overload where generic overload is the only candidate when called with type arguments
function fn2(s: string, n: number): number;
@ -43,7 +43,7 @@
// Generic and non - generic overload where non - generic overload is the only candidate when called with type arguments
fn2<Date>('', 0); // Error
~~
!!! Argument type 'string' is not assignable to parameter type 'number'.
!!! Argument of type 'string' is not assignable to parameter of type 'number'.
// Generic and non - generic overload where non - generic overload is the only candidate when called without type arguments
fn2('', 0); // OK
@ -80,14 +80,14 @@
~~~~~~
!!! Type 'number' does not satisfy the constraint 'string'.
~
!!! Argument type 'number' is not assignable to parameter type 'string'.
!!! Argument of type 'number' is not assignable to parameter of type 'string'.
fn4<number, string>('', 3); // Error
~~~~~~
!!! Type 'number' does not satisfy the constraint 'string'.
~~~~~~
!!! Type 'string' does not satisfy the constraint 'number'.
~~
!!! Argument type 'string' is not assignable to parameter type 'number'.
!!! Argument of type 'string' is not assignable to parameter of type 'number'.
fn4<number, string>(3, '');
~~~~~~
!!! Type 'number' does not satisfy the constraint 'string'.
@ -110,10 +110,10 @@
// Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints
fn4(true, null); // Error
~~~~
!!! Argument type 'boolean' is not assignable to parameter type 'number'.
!!! Argument of type 'boolean' is not assignable to parameter of type 'number'.
fn4(null, true); // Error
~~~~
!!! Argument type 'boolean' is not assignable to parameter type 'string'.
!!! Argument of type 'boolean' is not assignable to parameter of type 'string'.
// Non - generic overloads where contextual typing of function arguments has errors
function fn5(f: (n: string) => void): string;

View File

@ -27,7 +27,7 @@
// No candidate overloads found
new fn1({}); // Error
~~
!!! Argument type '{}' is not assignable to parameter type 'number'.
!!! Argument of type '{}' is not assignable to parameter of type 'number'.
// Generic and non - generic overload where generic overload is the only candidate when called with type arguments
class fn2<T> {
@ -81,14 +81,14 @@
new fn4<string, number>('', 3);
new fn4<string, number>(3, ''); // Error
~
!!! Argument type 'number' is not assignable to parameter type 'string'.
!!! Argument of type 'number' is not assignable to parameter of type 'string'.
new fn4<number, string>('', 3); // Error
~~~~~~
!!! Type 'number' does not satisfy the constraint 'string'.
~~~~~~
!!! Type 'string' does not satisfy the constraint 'number'.
~~
!!! Argument type 'string' is not assignable to parameter type 'number'.
!!! Argument of type 'string' is not assignable to parameter of type 'number'.
new fn4<number, string>(3, ''); // Error
~~~~~~
!!! Type 'number' does not satisfy the constraint 'string'.
@ -99,10 +99,10 @@
new fn4('', 3);
new fn4(3, ''); // Error
~
!!! Argument type 'number' is not assignable to parameter type 'string'.
!!! Argument of type 'number' is not assignable to parameter of type 'string'.
new fn4(3, undefined); // Error
~
!!! Argument type 'number' is not assignable to parameter type 'string'.
!!! Argument of type 'number' is not assignable to parameter of type 'string'.
new fn4('', null);
// Generic overloads with constraints called with type arguments that do not satisfy the constraints
@ -115,10 +115,10 @@
// Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints
new fn4(true, null); // Error
~~~~
!!! Argument type 'boolean' is not assignable to parameter type 'string'.
!!! Argument of type 'boolean' is not assignable to parameter of type 'string'.
new fn4(null, true); // Error
~~~~
!!! Argument type 'boolean' is not assignable to parameter type 'number'.
!!! Argument of type 'boolean' is not assignable to parameter of type 'number'.
// Non - generic overloads where contextual typing of function arguments has errors
class fn5 {

View File

@ -27,7 +27,7 @@
// No candidate overloads found
new fn1({}); // Error
~~
!!! Argument type '{}' is not assignable to parameter type 'number'.
!!! Argument of type '{}' is not assignable to parameter of type 'number'.
// Generic and non - generic overload where generic overload is the only candidate when called with type arguments
interface fn2 {
@ -45,7 +45,7 @@
// Generic and non - generic overload where non - generic overload is the only candidate when called with type arguments
new fn2<Date>('', 0); // Error
~~
!!! Argument type 'string' is not assignable to parameter type 'number'.
!!! Argument of type 'string' is not assignable to parameter of type 'number'.
// Generic and non - generic overload where non - generic overload is the only candidate when called without type arguments
new fn2('', 0); // OK
@ -87,14 +87,14 @@
~~~~~~
!!! Type 'number' does not satisfy the constraint 'string'.
~
!!! Argument type 'number' is not assignable to parameter type 'string'.
!!! Argument of type 'number' is not assignable to parameter of type 'string'.
new fn4<number, string>('', 3); // Error
~~~~~~
!!! Type 'number' does not satisfy the constraint 'string'.
~~~~~~
!!! Type 'string' does not satisfy the constraint 'number'.
~~
!!! Argument type 'string' is not assignable to parameter type 'number'.
!!! Argument of type 'string' is not assignable to parameter of type 'number'.
new fn4<number, string>(3, '');
~~~~~~
!!! Type 'number' does not satisfy the constraint 'string'.
@ -117,10 +117,10 @@
// Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints
new fn4(true, null); // Error
~~~~
!!! Argument type 'boolean' is not assignable to parameter type 'number'.
!!! Argument of type 'boolean' is not assignable to parameter of type 'number'.
new fn4(null, true); // Error
~~~~
!!! Argument type 'boolean' is not assignable to parameter type 'string'.
!!! Argument of type 'boolean' is not assignable to parameter of type 'string'.
// Non - generic overloads where contextual typing of function arguments has errors
interface fn5 {

View File

@ -2,4 +2,4 @@
function foo(b: (item: number) => boolean) { }
foo(a => a); // can not convert (number)=>bool to (number)=>number
~~~~~~
!!! Argument type '(a: number) => number' is not assignable to parameter type '(item: number) => boolean'.
!!! Argument of type '(a: number) => number' is not assignable to parameter of type '(item: number) => boolean'.

View File

@ -8,7 +8,7 @@
var x11 = foo([{a:0}]); // works
var x111 = foo([{a:"s"}]); // error - does not match any signature
~~~~~~~~~
!!! Argument type '{ a: string; }[]' is not assignable to parameter type '{ a: boolean; }[]'.
!!! Argument of type '{ a: string; }[]' is not assignable to parameter of type '{ a: boolean; }[]'.
!!! Type '{ a: string; }' is not assignable to type '{ a: boolean; }':
!!! Types of property 'a' are incompatible:
!!! Type 'string' is not assignable to type 'boolean'.
@ -24,7 +24,7 @@
var x3 = foo2({a:true}); // works
var x4 = foo2({a:"s"}); // error
~~~~~~~
!!! Argument type '{ a: string; }' is not assignable to parameter type '{ a: boolean; }'.
!!! Argument of type '{ a: string; }' is not assignable to parameter of type '{ a: boolean; }'.
!!! Types of property 'a' are incompatible:
!!! Type 'string' is not assignable to type 'boolean'.
@ -34,6 +34,6 @@
function foo4(bar:{a:any;}):any{ return bar };
var x = foo4({a:true}); // error
~~~~~~~~
!!! Argument type '{ a: boolean; }' is not assignable to parameter type '{ a: string; }'.
!!! Argument of type '{ a: boolean; }' is not assignable to parameter of type '{ a: string; }'.
!!! Types of property 'a' are incompatible:
!!! Type 'boolean' is not assignable to type 'string'.

View File

@ -19,7 +19,7 @@
var b: E = foo("bye", []); // E
var c = foo("um", []); // error
~~~~
!!! Argument type 'string' is not assignable to parameter type '"bye"'.
!!! Argument of type 'string' is not assignable to parameter of type '"bye"'.
//function bar(x: "hi", items: string[]): D;

View File

@ -16,11 +16,11 @@
~~~~~~
!!! Type 'string' is not assignable to type 'number'.
~
!!! Argument type 'D' is not assignable to parameter type 'A'.
!!! Argument of type 'D' is not assignable to parameter of type 'A'.
var result2: number = foo(x => new G<typeof x>(x)); // No error, returns number
~~~~~~~~~~~~~~~~~~~~~~~
!!! Argument type '(x: D) => G<D>' is not assignable to parameter type '(x: B) => any'.
!!! Argument of type '(x: D) => G<D>' is not assignable to parameter of type '(x: B) => any'.
~~~~~~~~
!!! Type 'D' does not satisfy the constraint 'A'.
@ -34,5 +34,5 @@
~~~~~~~~~~~~~
});
~
!!! Argument type '(x: D) => G<D>' is not assignable to parameter type '(x: B) => any'.
!!! Argument of type '(x: D) => G<D>' is not assignable to parameter of type '(x: B) => any'.

View File

@ -6,12 +6,12 @@
func(s => ({})); // Error for no applicable overload (object type is missing a and b)
~~~~~~~~~
!!! Argument type '(s: string) => {}' is not assignable to parameter type '(s: string) => { a: number; b: number; }'.
!!! 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 type '(s: string) => { a: unknown; }' is not assignable to parameter type '(s: string) => { a: number; b: number; }'.
!!! Argument of type '(s: string) => { a: unknown; }' is not assignable to parameter of type '(s: string) => { a: number; b: number; }'.
~~~~
!!! Cannot find name 'blah'.

View File

@ -7,8 +7,8 @@
foo(g);
foo(() => g);
~~~~~~~
!!! Argument type '() => (x: string) => string' is not assignable to parameter type '(x: string) => string'.
!!! Argument of type '() => (x: string) => string' is not assignable to parameter of type '(x: string) => string'.
foo(x);
~
!!! Argument type '() => (x: string) => string' is not assignable to parameter type '(x: string) => string'.
!!! Argument of type '() => (x: string) => string' is not assignable to parameter of type '(x: string) => string'.

View File

@ -8,7 +8,7 @@
var x = new C<number>();
x.bar2(2, ""); // should error
~~
!!! Argument type 'string' is not assignable to parameter type 'number'.
!!! Argument of type 'string' is not assignable to parameter of type 'number'.
x.bar2<string>(2, ""); // should error
~~~~~~
!!! Type 'string' does not satisfy the constraint 'number'.

View File

@ -7,7 +7,7 @@
// should get a fresh type parameter which each then call
var z = this.then(x => result)/*S*/.then(x => "abc")/*Function*/.then(x => x.length)/*number*/; // Should error on "abc" because it is not a Function
~~~~~~~~~~
!!! Argument type '(x: S) => string' is not assignable to parameter type '(x: S) => Function'.
!!! Argument of type '(x: S) => string' is not assignable to parameter of type '(x: S) => Function'.
return new Chain2(result);
}
}

View File

@ -7,7 +7,7 @@
// should get a fresh type parameter which each then call
var z = this.then(x => result).then(x => "abc").then(x => x.length);
~~~~~~~~~~
!!! Argument type '(x: S) => string' is not assignable to parameter type '(x: S) => Function'.
!!! Argument of type '(x: S) => string' is not assignable to parameter of type '(x: S) => Function'.
return new Chain2(result);
}
}

View File

@ -79,69 +79,69 @@
var sPromise: (x: any) => Promise<string>;
var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error
~~~~~~~~~~~~~
!!! Argument type '(x: number, y?: string) => IPromise<string>' is not assignable to parameter type '(value: string) => IPromise<string>'.
!!! Argument of type '(x: number, y?: string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); // ok
var s4: Promise<string>;
var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error
~~~~~~~~~~~~~
!!! Argument type '(x: number, y?: string) => IPromise<string>' is not assignable to parameter type '(value: string) => IPromise<string>'.
!!! Argument of type '(x: number, y?: string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error
~~~~~~~~~~~~~~
!!! Argument type '(x: number, y?: string) => Promise<string>' is not assignable to parameter type '(value: string) => Promise<string>'.
!!! Argument of type '(x: number, y?: string) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error
~~~~~~~~~~~~~~
!!! Argument type '(x: number, y?: string) => Promise<string>' is not assignable to parameter type '(value: string) => IPromise<string>'.
!!! Argument of type '(x: number, y?: string) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4);
var r5: IPromise<string>;
var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error
~~~~~~~~~~~~~
!!! Argument type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter type '(value: string) => IPromise<string>'.
!!! Argument of type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok
var s5: Promise<string>;
var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error
~~~~~~~~~~~~~
!!! Argument type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter type '(value: string) => IPromise<string>'.
!!! Argument of type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error
~~~~~~~~~~~~~~
!!! Argument type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter type '(value: string) => Promise<string>'.
!!! Argument of type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error
~~~~~~~~~~~~~~
!!! Argument type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter type '(value: string) => IPromise<string>'.
!!! Argument of type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok
var r6: IPromise<string>;
var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error
~~~~~~~~~~~~~
!!! Argument type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter type '(value: string) => IPromise<string>'.
!!! Argument of type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok
var s6: Promise<string>;
var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error
~~~~~~~~~~~~~
!!! Argument type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter type '(value: string) => IPromise<string>'.
!!! Argument of type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error
~~~~~~~~~~~~~~
!!! Argument type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter type '(value: string) => Promise<string>'.
!!! Argument of type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error
~~~~~~~~~~~~~~
!!! Argument type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter type '(value: string) => IPromise<string>'.
!!! Argument of type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok
var r7: IPromise<string>;
var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error
~~~~~~~~~~~~~
!!! Argument type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter type '(value: string) => IPromise<string>'.
!!! Argument of type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok
var s7: Promise<string>;
var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error
~~~~~~~~~~~~~
!!! Argument type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter type '(value: string) => IPromise<string>'.
!!! Argument of type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error
~~~~~~~~~~~~~~
!!! Argument type '(cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter type '(value: string) => Promise<string>'.
!!! Argument of type '(cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error
~~~~~~~~~~~~~~
!!! Argument type '(cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter type '(value: string) => IPromise<string>'.
!!! Argument of type '(cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); // ok?
var r8: IPromise<number>;
@ -149,24 +149,24 @@
var nPromise: (x: any) => Promise<number>;
var r8a = r8.then(testFunction8, testFunction8, testFunction8); // error
~~~~~~~~~~~~~
!!! Argument type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter type '(value: number) => IPromise<number>'.
!!! Argument of type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<number>'.
var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok
var s8: Promise<number>;
var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error
~~~~~~~~~~~~~
!!! Argument type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter type '(value: number) => IPromise<number>'.
!!! Argument of type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<number>'.
var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error
~~~~~~~~~~~~~~
!!! Argument type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter type '(value: number) => Promise<number>'.
!!! Argument of type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter of type '(value: number) => Promise<number>'.
var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error
~~~~~~~~~~~~~~
!!! Argument type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter type '(value: number) => IPromise<any>'.
!!! Argument of type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok
var r9: IPromise<number>;
var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error
~~~~~~~~~~~~~
!!! Argument type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter type '(value: number) => IPromise<number>'.
!!! Argument of type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<number>'.
var r9b = r9.then(sIPromise, sIPromise, sIPromise); // ok
var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok
var r9d = r9.then(testFunction, sIPromise, nIPromise); // ok
@ -174,13 +174,13 @@
var s9: Promise<number>;
var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error
~~~~~~~~~~~~~
!!! Argument type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter type '(value: number) => IPromise<number>'.
!!! Argument of type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<number>'.
var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error
~~~~~~~~~~~~~~
!!! Argument type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter type '(value: number) => Promise<number>'.
!!! Argument of type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter of type '(value: number) => Promise<number>'.
var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error
~~~~~~~~~~~~~~
!!! Argument type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter type '(value: number) => IPromise<any>'.
!!! Argument of type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
var s9d = s9.then(sPromise, sPromise, sPromise); // ok
var s9e = s9.then(nPromise, nPromise, nPromise); // ok
var s9f = s9.then(testFunction, sIPromise, nIPromise); // ok
@ -206,7 +206,7 @@
var s11: Promise<number>;
var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok
~~~~~~~~~~~~~~
!!! Argument type '{ (x: number): IPromise<number>; (x: string): IPromise<string>; }' is not assignable to parameter type '(value: number) => IPromise<string>'.
!!! Argument of type '{ (x: number): IPromise<number>; (x: string): IPromise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // ok
var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // ok

View File

@ -73,76 +73,76 @@
var s3c = s3.then(testFunction3P, testFunction3, testFunction3);
var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); // Should error
~~~~~~~~~~~~~
!!! Argument type '(x: number) => IPromise<number>' is not assignable to parameter type '(value: IPromise<number>) => IPromise<number>'.
!!! Argument of type '(x: number) => IPromise<number>' is not assignable to parameter of type '(value: IPromise<number>) => IPromise<number>'.
var r4: IPromise<string>;
var sIPromise: (x: any) => IPromise<string>;
var sPromise: (x: any) => Promise<string>;
var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error
~~~~~~~~~~~~~
!!! Argument type '(x: number, y?: string) => IPromise<string>' is not assignable to parameter type '(value: string) => IPromise<string>'.
!!! Argument of type '(x: number, y?: string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); // ok
var s4: Promise<string>;
var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error
~~~~~~~~~~~~~
!!! Argument type '(x: number, y?: string) => IPromise<string>' is not assignable to parameter type '(value: string) => IPromise<string>'.
!!! Argument of type '(x: number, y?: string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error
~~~~~~~~~~~~~~
!!! Argument type '(x: number, y?: string) => Promise<string>' is not assignable to parameter type '(value: string) => Promise<string>'.
!!! Argument of type '(x: number, y?: string) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error
~~~~~~~~~~~~~~
!!! Argument type '(x: number, y?: string) => Promise<string>' is not assignable to parameter type '(value: string) => IPromise<string>'.
!!! Argument of type '(x: number, y?: string) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4);
var r5: IPromise<string>;
var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error
~~~~~~~~~~~~~
!!! Argument type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter type '(value: string) => IPromise<string>'.
!!! Argument of type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok
var s5: Promise<string>;
var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error
~~~~~~~~~~~~~
!!! Argument type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter type '(value: string) => IPromise<string>'.
!!! Argument of type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error
~~~~~~~~~~~~~~
!!! Argument type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter type '(value: string) => Promise<string>'.
!!! Argument of type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error
~~~~~~~~~~~~~~
!!! Argument type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter type '(value: string) => IPromise<string>'.
!!! Argument of type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok
var r6: IPromise<string>;
var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error
~~~~~~~~~~~~~
!!! Argument type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter type '(value: string) => IPromise<string>'.
!!! Argument of type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok
var s6: Promise<string>;
var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error
~~~~~~~~~~~~~
!!! Argument type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter type '(value: string) => IPromise<string>'.
!!! Argument of type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error
~~~~~~~~~~~~~~
!!! Argument type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter type '(value: string) => Promise<string>'.
!!! Argument of type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error
~~~~~~~~~~~~~~
!!! Argument type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter type '(value: string) => IPromise<string>'.
!!! Argument of type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok
var r7: IPromise<string>;
var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error
~~~~~~~~~~~~~
!!! Argument type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter type '(value: string) => IPromise<string>'.
!!! Argument of type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok
var s7: Promise<string>;
var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error
~~~~~~~~~~~~~
!!! Argument type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter type '(value: string) => IPromise<string>'.
!!! Argument of type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error
~~~~~~~~~~~~~~
!!! Argument type '(cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter type '(value: string) => Promise<string>'.
!!! Argument of type '(cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error
~~~~~~~~~~~~~~
!!! Argument type '(cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter type '(value: string) => IPromise<string>'.
!!! Argument of type '(cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); // ok?
var r8: IPromise<number>;
@ -150,24 +150,24 @@
var nPromise: (x: any) => Promise<number>;
var r8a = r8.then(testFunction8, testFunction8, testFunction8); // error
~~~~~~~~~~~~~
!!! Argument type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter type '(value: number) => IPromise<number>'.
!!! Argument of type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<number>'.
var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok
var s8: Promise<number>;
var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error
~~~~~~~~~~~~~
!!! Argument type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter type '(value: number) => IPromise<number>'.
!!! Argument of type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<number>'.
var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error
~~~~~~~~~~~~~~
!!! Argument type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter type '(value: number) => Promise<number>'.
!!! Argument of type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter of type '(value: number) => Promise<number>'.
var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error
~~~~~~~~~~~~~~
!!! Argument type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter type '(value: number) => IPromise<any>'.
!!! Argument of type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok
var r9: IPromise<number>;
var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error
~~~~~~~~~~~~~
!!! Argument type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter type '(value: number) => IPromise<number>'.
!!! Argument of type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<number>'.
var r9b = r9.then(sIPromise, sIPromise, sIPromise); // ok
var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok
var r9d = r9.then(testFunction, sIPromise, nIPromise); // ok
@ -175,13 +175,13 @@
var s9: Promise<number>;
var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error
~~~~~~~~~~~~~
!!! Argument type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter type '(value: number) => IPromise<number>'.
!!! Argument of type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<number>'.
var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error
~~~~~~~~~~~~~~
!!! Argument type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter type '(value: number) => Promise<number>'.
!!! Argument of type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter of type '(value: number) => Promise<number>'.
var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error
~~~~~~~~~~~~~~
!!! Argument type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter type '(value: number) => IPromise<any>'.
!!! Argument of type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
var s9d = s9.then(sPromise, sPromise, sPromise); // ok
var s9e = s9.then(nPromise, nPromise, nPromise); // ok
var s9f = s9.then(testFunction, sIPromise, nIPromise); // ok
@ -207,13 +207,13 @@
var s11: Promise<number>;
var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok
~~~~~~~~~~~~~~
!!! Argument type '{ (x: number): IPromise<number>; (x: string): IPromise<string>; }' is not assignable to parameter type '(value: number) => IPromise<string>'.
!!! Argument of type '{ (x: number): IPromise<number>; (x: string): IPromise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // ok
~~~~~~~~~~~~~~~
!!! Argument type '{ (x: number): Promise<number>; (x: string): Promise<string>; }' is not assignable to parameter type '(value: number) => Promise<string>'.
!!! Argument of type '{ (x: number): Promise<number>; (x: string): Promise<string>; }' is not assignable to parameter of type '(value: number) => Promise<string>'.
var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // ok
~~~~~~~~~~~~~~~
!!! Argument type '{ (x: number): Promise<number>; (x: string): Promise<string>; }' is not assignable to parameter type '(value: number) => IPromise<string>'.
!!! Argument of type '{ (x: number): Promise<number>; (x: string): Promise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
var r12 = testFunction12(x => x);
var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok

View File

@ -68,7 +68,7 @@
var r3a = r3.then(testFunction3, testFunction3, testFunction3);
var r3b = r3.then(testFunction3, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3);
~~~~~~~~~~~~~
!!! Argument type '(x: number) => IPromise<number>' is not assignable to parameter type '(value: IPromise<number>) => IPromise<number>'.
!!! Argument of type '(x: number) => IPromise<number>' is not assignable to parameter of type '(value: IPromise<number>) => IPromise<number>'.
var s3: Promise<number>;
var s3a = s3.then(testFunction3, testFunction3, testFunction3);
var s3b = s3.then(testFunction3P, testFunction3P, testFunction3P);
@ -80,69 +80,69 @@
var sPromise: (x: any) => Promise<string>;
var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error
~~~~~~~~~~~~~
!!! Argument type '(x: number, y?: string) => IPromise<string>' is not assignable to parameter type '(value: string) => IPromise<string>'.
!!! Argument of type '(x: number, y?: string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); // ok
var s4: Promise<string>;
var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error
~~~~~~~~~~~~~
!!! Argument type '(x: number, y?: string) => IPromise<string>' is not assignable to parameter type '(value: string) => IPromise<string>'.
!!! Argument of type '(x: number, y?: string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error
~~~~~~~~~~~~~~
!!! Argument type '(x: number, y?: string) => Promise<string>' is not assignable to parameter type '(value: string) => Promise<string>'.
!!! Argument of type '(x: number, y?: string) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error
~~~~~~~~~~~~~~
!!! Argument type '(x: number, y?: string) => Promise<string>' is not assignable to parameter type '(value: string) => IPromise<string>'.
!!! Argument of type '(x: number, y?: string) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4);
var r5: IPromise<string>;
var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error
~~~~~~~~~~~~~
!!! Argument type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter type '(value: string) => IPromise<string>'.
!!! Argument of type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok
var s5: Promise<string>;
var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error
~~~~~~~~~~~~~
!!! Argument type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter type '(value: string) => IPromise<string>'.
!!! Argument of type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error
~~~~~~~~~~~~~~
!!! Argument type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter type '(value: string) => Promise<string>'.
!!! Argument of type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error
~~~~~~~~~~~~~~
!!! Argument type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter type '(value: string) => IPromise<string>'.
!!! Argument of type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok
var r6: IPromise<string>;
var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error
~~~~~~~~~~~~~
!!! Argument type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter type '(value: string) => IPromise<string>'.
!!! Argument of type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok
var s6: Promise<string>;
var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error
~~~~~~~~~~~~~
!!! Argument type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter type '(value: string) => IPromise<string>'.
!!! Argument of type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error
~~~~~~~~~~~~~~
!!! Argument type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter type '(value: string) => Promise<string>'.
!!! Argument of type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error
~~~~~~~~~~~~~~
!!! Argument type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter type '(value: string) => IPromise<string>'.
!!! Argument of type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok
var r7: IPromise<string>;
var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error
~~~~~~~~~~~~~
!!! Argument type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter type '(value: string) => IPromise<string>'.
!!! Argument of type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok
var s7: Promise<string>;
var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error
~~~~~~~~~~~~~
!!! Argument type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter type '(value: string) => IPromise<string>'.
!!! Argument of type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error
~~~~~~~~~~~~~~
!!! Argument type '(cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter type '(value: string) => Promise<string>'.
!!! Argument of type '(cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error
~~~~~~~~~~~~~~
!!! Argument type '(cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter type '(value: string) => IPromise<string>'.
!!! Argument of type '(cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); // ok?
var r8: IPromise<number>;
@ -150,24 +150,24 @@
var nPromise: (x: any) => Promise<number>;
var r8a = r8.then(testFunction8, testFunction8, testFunction8); // error
~~~~~~~~~~~~~
!!! Argument type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter type '(value: number) => IPromise<number>'.
!!! Argument of type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<number>'.
var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok
var s8: Promise<number>;
var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error
~~~~~~~~~~~~~
!!! Argument type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter type '(value: number) => IPromise<number>'.
!!! Argument of type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<number>'.
var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error
~~~~~~~~~~~~~~
!!! Argument type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter type '(value: number) => Promise<number>'.
!!! Argument of type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter of type '(value: number) => Promise<number>'.
var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error
~~~~~~~~~~~~~~
!!! Argument type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter type '(value: number) => IPromise<any>'.
!!! Argument of type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok
var r9: IPromise<number>;
var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error
~~~~~~~~~~~~~
!!! Argument type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter type '(value: number) => IPromise<number>'.
!!! Argument of type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<number>'.
var r9b = r9.then(sIPromise, sIPromise, sIPromise); // ok
var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok
var r9d = r9.then(testFunction, sIPromise, nIPromise); // ok
@ -175,13 +175,13 @@
var s9: Promise<number>;
var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error
~~~~~~~~~~~~~
!!! Argument type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter type '(value: number) => IPromise<number>'.
!!! Argument of type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<number>'.
var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error
~~~~~~~~~~~~~~
!!! Argument type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter type '(value: number) => Promise<number>'.
!!! Argument of type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter of type '(value: number) => Promise<number>'.
var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error
~~~~~~~~~~~~~~
!!! Argument type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter type '(value: number) => IPromise<any>'.
!!! Argument of type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
var s9d = s9.then(sPromise, sPromise, sPromise); // ok
var s9e = s9.then(nPromise, nPromise, nPromise); // ok
var s9f = s9.then(testFunction, sIPromise, nIPromise); // ok
@ -205,11 +205,11 @@
var r11: IPromise<number>;
var r11a = r11.then(testFunction11, testFunction11, testFunction11); // ok
~~~~~~~~~~~~~~
!!! Argument type '{ (x: number): IPromise<number>; (x: string): IPromise<string>; }' is not assignable to parameter type '(value: number) => IPromise<string>'.
!!! Argument of type '{ (x: number): IPromise<number>; (x: string): IPromise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
var s11: Promise<number>;
var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok
~~~~~~~~~~~~~~
!!! Argument type '{ (x: number): IPromise<number>; (x: string): IPromise<string>; }' is not assignable to parameter type '(value: number) => IPromise<string>'.
!!! Argument of type '{ (x: number): IPromise<number>; (x: string): IPromise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // ok
var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // ok
@ -219,5 +219,5 @@
var s12a = s12.then(testFunction12, testFunction12, testFunction12); // ok
var s12b = s12.then(testFunction12P, testFunction12P, testFunction12P); // ok
~~~~~~~~~~~~~~~
!!! Argument type '{ <T>(x: T): IPromise<T>; <T>(x: T, y: T): Promise<T>; }' is not assignable to parameter type '(value: (x: any) => any) => Promise<any>'.
!!! Argument of type '{ <T>(x: T): IPromise<T>; <T>(x: T, y: T): Promise<T>; }' is not assignable to parameter of type '(value: (x: any) => any) => Promise<any>'.
var s12c = s12.then(testFunction12P, testFunction12, testFunction12); // ok

View File

@ -101,7 +101,7 @@
public getInitialState(): IState {
return new State(self);
~~~~
!!! Argument type 'Window' is not assignable to parameter type 'IMode'.
!!! Argument of type 'Window' is not assignable to parameter of type 'IMode'.
}

View File

@ -35,7 +35,7 @@
}
C.g(3); // error
~
!!! Argument type 'number' is not assignable to parameter type '(t: typeof g) => void'.
!!! Argument of type 'number' is not assignable to parameter of type '(t: typeof g) => void'.
var f4: () => typeof f4;
f4 = 3; // error
@ -53,7 +53,7 @@
!!! Supplied parameters do not match any signature of call target.
f6(""); // ok (function takes an any param)
~~
!!! Argument type 'string' is not assignable to parameter type '{ (): typeof f6; (a: typeof f6): () => number; }'.
!!! Argument of type 'string' is not assignable to parameter of type '{ (): typeof f6; (a: typeof f6): () => number; }'.
f6(); // ok
declare function f7(): typeof f7;
@ -66,5 +66,5 @@
!!! Supplied parameters do not match any signature of call target.
f7(""); // ok (function takes an any param)
~~
!!! Argument type 'string' is not assignable to parameter type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'.
!!! Argument of type 'string' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'.
f7(); // ok

View File

@ -7,9 +7,9 @@
// both are errors
x3(1, (x: string) => 1);
~
!!! Argument type 'number' is not assignable to parameter type 'string'.
!!! Argument of type 'number' is not assignable to parameter of type 'string'.
x3(1, (x: 'hm') => 1);
~
!!! Argument type 'number' is not assignable to parameter type 'string'.
!!! Argument of type 'number' is not assignable to parameter of type 'string'.
~~~~~~~~~~~~~~
!!! A signature with an implementation cannot use a string literal type.

View File

@ -2,4 +2,4 @@
var x = '';
var d = x['charAt']('invalid'); // error
~~~~~~~~~
!!! Argument type 'string' is not assignable to parameter type 'number'.
!!! Argument of type 'string' is not assignable to parameter of type 'number'.

View File

@ -2,4 +2,4 @@
declare function foo3(cb: (x: number) => number): typeof cb;
var r5 = foo3((x: number) => ''); // error
~~~~~~~~~~~~~~~~~
!!! Argument type '(x: number) => string' is not assignable to parameter type '(x: number) => number'.
!!! Argument of type '(x: number) => string' is not assignable to parameter of type '(x: number) => number'.

View File

@ -5,11 +5,11 @@
// these two should give the same error
this.test([1, 2, "hi", 5, ]);
~~~~~~~~~~~~~~~~~
!!! Argument type '{}[]' is not assignable to parameter type 'number[]'.
!!! Argument of type '{}[]' is not assignable to parameter of type 'number[]'.
!!! Type '{}' is not assignable to type 'number'.
this.test([1, 2, "hi", 5]);
~~~~~~~~~~~~~~~
!!! Argument type '{}[]' is not assignable to parameter type 'number[]'.
!!! Argument of type '{}[]' is not assignable to parameter of type 'number[]'.
!!! Type '{}' is not assignable to type 'number'.
}
}

View File

@ -7,4 +7,4 @@
var z7 = foo("abc", 5); // Error
~~~~~
!!! Argument type 'string' is not assignable to parameter type 'Item'.
!!! Argument of type 'string' is not assignable to parameter of type 'Item'.

View File

@ -25,7 +25,7 @@
new someGenerics1(3, 4);
new someGenerics1<string, number>(3, 4); // Error
~
!!! Argument type 'number' is not assignable to parameter type 'string'.
!!! Argument of type 'number' is not assignable to parameter of type 'string'.
new someGenerics1<number, {}>(3, 4);
// Generic call with argument of function type whose parameter is of type parameter type
@ -65,7 +65,7 @@
new someGenerics4<string, number>('', () => 3);
new someGenerics4<string, number>('', (x: string) => ''); // Error
~~~~~~~~~~~~~~~~~
!!! Argument type '(x: string) => string' is not assignable to parameter type '(x: number) => void'.
!!! Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'.
new someGenerics4<string, number>(null, null);
// 2 parameter generic call with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type
@ -77,7 +77,7 @@
new someGenerics5<number, string>('', () => 3);
new someGenerics5<number, string>('', (x: string) => ''); // Error
~~~~~~~~~~~~~~~~~
!!! Argument type '(x: string) => string' is not assignable to parameter type '(x: number) => void'.
!!! Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'.
new someGenerics5<string, number>(null, null);
// Generic call with multiple arguments of function types that each have parameters of the same generic type
@ -89,7 +89,7 @@
new someGenerics6<number>(n => n, n => n, n => n);
new someGenerics6<number>((n: number) => n, (n: string) => n, (n: number) => n); // Error
~~~~~~~~~~~~~~~~
!!! Argument type '(n: string) => string' is not assignable to parameter type '(b: number) => number'.
!!! Argument of type '(n: string) => string' is not assignable to parameter of type '(b: number) => number'.
new someGenerics6<number>((n: number) => n, (n: number) => n, (n: number) => n);
// Generic call with multiple arguments of function types that each have parameters of different generic type

View File

@ -3,23 +3,23 @@
function someGenerics1<T, U>(n: T, m: number) { }
someGenerics1<string, number>(3, 4); // Error
~
!!! Argument type 'number' is not assignable to parameter type 'string'.
!!! Argument of type 'number' is not assignable to parameter of type 'string'.
// 2 parameter generic call with argument 1 of type parameter type and argument 2 of function type whose parameter is of type parameter type
function someGenerics4<T, U>(n: T, f: (x: U) => void) { }
someGenerics4<string, number>('', (x: string) => ''); // Error
~~~~~~~~~~~~~~~~~
!!! Argument type '(x: string) => string' is not assignable to parameter type '(x: number) => void'.
!!! Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'.
// 2 parameter generic call with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type
function someGenerics5<U, T>(n: T, f: (x: U) => void) { }
someGenerics5<number, string>('', (x: string) => ''); // Error
~~~~~~~~~~~~~~~~~
!!! Argument type '(x: string) => string' is not assignable to parameter type '(x: number) => void'.
!!! Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'.
// Generic call with multiple arguments of function types that each have parameters of the same generic type
function someGenerics6<A>(a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) { }
someGenerics6<number>((n: number) => n, (n: string) => n, (n: number) => n); // Error
~~~~~~~~~~~~~~~~
!!! Argument type '(n: string) => string' is not assignable to parameter type '(b: number) => number'.
!!! Argument of type '(n: string) => string' is not assignable to parameter of type '(b: number) => number'.

Some files were not shown because too many files have changed in this diff Show More