1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
tests/cases/conformance/salsa/typeFromPropertyAssignment31.ts(13,1): error TS2322: Type 'boolean' is not assignable to type 'number'.
tests/cases/conformance/salsa/typeFromPropertyAssignment31.ts(25,1): error TS2322: Type 'boolean' is not assignable to type 'number'.
==== tests/cases/conformance/salsa/typeFromPropertyAssignment31.ts (2 errors) ====
function ExpandoMerge(n: number) {
return n;
}
ExpandoMerge.p1 = 111
ExpandoMerge.m = function(n: number) {
return n + 1;
}
namespace ExpandoMerge {
export var p2 = 222;
}
ExpandoMerge.p4 = 44444; // ok
ExpandoMerge.p6 = 66666; // ok
ExpandoMerge.p8 = false; // type error
~~~~~~~~~~~~~~~
!!! error TS2322: Type 'boolean' is not assignable to type 'number'.
namespace ExpandoMerge {
export var p3 = 333;
export var p4 = 4;
export var p5 = 5;
export let p6 = 6;
export let p7 = 7;
export var p8 = 6;
export let p9 = 7;
}
ExpandoMerge.p5 = 555555; // ok
ExpandoMerge.p7 = 777777; // ok
ExpandoMerge.p9 = false; // type error
~~~~~~~~~~~~~~~
!!! error TS2322: Type 'boolean' is not assignable to type 'number'.
var n = ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) + ExpandoMerge(1001);
|