Files
tsgo/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionsCjs.errors.txt

74 lines
2.1 KiB
Plaintext

index.js(4,18): error TS2339: Property 'cat' does not exist on type '() => void'.
index.js(7,18): error TS2339: Property 'Cls' does not exist on type '() => void'.
index.js(31,18): error TS2339: Property 'self' does not exist on type '<T>(a: T) => T'.
index.js(57,36): error TS2565: Property 'j' is used before being assigned.
==== index.js (4 errors) ====
module.exports.a = function a() {}
module.exports.b = function b() {}
module.exports.b.cat = "cat";
~~~
!!! error TS2339: Property 'cat' does not exist on type '() => void'.
module.exports.c = function c() {}
module.exports.c.Cls = class {}
~~~
!!! error TS2339: Property 'Cls' does not exist on type '() => void'.
/**
* @param {number} a
* @param {number} b
* @return {string}
*/
module.exports.d = function d(a, b) { return /** @type {*} */(null); }
/**
* @template T,U
* @param {T} a
* @param {U} b
* @return {T & U}
*/
module.exports.e = function e(a, b) { return /** @type {*} */(null); }
/**
* @template T
* @param {T} a
*/
module.exports.f = function f(a) {
return a;
}
module.exports.f.self = module.exports.f;
~~~~
!!! error TS2339: Property 'self' does not exist on type '<T>(a: T) => T'.
/**
* @param {{x: string}} a
* @param {{y: typeof module.exports.b}} b
*/
function g(a, b) {
return a.x && b.y();
}
module.exports.g = g;
/**
* @param {{x: string}} a
* @param {{y: typeof module.exports.b}} b
*/
function hh(a, b) {
return a.x && b.y();
}
module.exports.h = hh;
module.exports.i = function i() {}
module.exports.ii = module.exports.i;
// note that this last one doesn't make much sense in cjs, since exports aren't hoisted bindings
module.exports.jj = module.exports.j;
~
!!! error TS2565: Property 'j' is used before being assigned.
module.exports.j = function j() {}