Files
tsgo/testdata/baselines/reference/submodule/compiler/ambientPropertyDeclarationInJs.errors.txt

27 lines
944 B
Plaintext

/test.js(3,9): error TS2322: Type '{}' is not assignable to type 'string'.
/test.js(6,5): error TS8009: The 'declare' modifier can only be used in TypeScript files.
/test.js(6,19): error TS8010: Type annotations can only be used in TypeScript files.
/test.js(9,19): error TS2339: Property 'foo' does not exist on type 'string'.
==== /test.js (4 errors) ====
class Foo {
constructor() {
this.prop = {};
~~~~~~~~~
!!! error TS2322: Type '{}' is not assignable to type 'string'.
}
declare prop: string;
~~~~~~~
!!! error TS8009: The 'declare' modifier can only be used in TypeScript files.
~~~~~~
!!! error TS8010: Type annotations can only be used in TypeScript files.
method() {
this.prop.foo
~~~
!!! error TS2339: Property 'foo' does not exist on type 'string'.
}
}