TypeScript/tests/baselines/reference/jsFileClassPropertyType3.errors.txt
2017-02-09 14:55:07 -08:00

22 lines
547 B
Plaintext

tests/cases/compiler/bar.ts(2,1): error TS2322: Type '"string"' is not assignable to type 'number'.
==== tests/cases/compiler/foo.js (0 errors) ====
class C {
constructor() {
if (cond) {
this.p = null;
}
else {
this.p = 0;
}
}
}
==== tests/cases/compiler/bar.ts (1 errors) ====
(new C()).p = "string"; // Error
~~~~~~~~~~~
!!! error TS2322: Type '"string"' is not assignable to type 'number'.