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

22 lines
795 B
Plaintext

/a.js(8,9): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation.
/a.js(12,18): error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type.
==== /a.js (2 errors) ====
exports.x = 0;
exports.x;
// Works nested
{
// 'exports' does not provide a contextual type to a function-class
exports.Cls = function() {
this.x = 0;
~~~~
!!! error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation.
}
}
const instance = new exports.Cls();
~~~~~~~~~~~~~~~~~
!!! error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type.