TypeScript/tests/baselines/reference/typedefOnStatements.errors.txt
Nathan Shively-Sanders 6a3d68905c
Add jsdoc to all js statements (#43659)
* Add jsdoc to if statements

This should only happen in JS files, however, and there needs to be some
conditional handling of jsdoc on statements that can't have jsdoc in TS
files.

* Finish change

* Add test
2021-04-13 15:30:22 -07:00

94 lines
2.9 KiB
Plaintext

tests/cases/conformance/jsdoc/typedefOnStatements.js(26,1): error TS1105: A 'break' statement can only be used within an enclosing iteration or switch statement.
tests/cases/conformance/jsdoc/typedefOnStatements.js(31,1): error TS1104: A 'continue' statement can only be used within an enclosing iteration statement.
tests/cases/conformance/jsdoc/typedefOnStatements.js(33,1): error TS1101: 'with' statements are not allowed in strict mode.
tests/cases/conformance/jsdoc/typedefOnStatements.js(33,1): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'.
==== tests/cases/conformance/jsdoc/typedefOnStatements.js (4 errors) ====
/** @typedef {{a: string}} A */
;
/** @typedef {{ b: string }} B */
debugger;
/** @typedef {{ c: string }} C */
{
}
/** @typedef {{ d: string }} D */
1 + 1;
/** @typedef {{ e: string }} E */
if (false) {
}
/** @typedef {{ f: string }} F */
do {
} while (false);
/** @typedef {{ g: string }} G */
while (false) {
}
/** @typedef {{ h: string }} H */
for (;; false) {
}
/** @typedef {{ i: string }} I */
for (let i in []) {
}
/** @typedef {{ j: string }} J */
break;
~~~~~~
!!! error TS1105: A 'break' statement can only be used within an enclosing iteration or switch statement.
/** @typedef {{ k: string }} K */
for (let k of []) {
}
/** @typedef {{ l: string }} L */
continue;
~~~~~~~~~
!!! error TS1104: A 'continue' statement can only be used within an enclosing iteration statement.
/** @typedef {{ m: string }} M */
with (name) {
~~~~
!!! error TS1101: 'with' statements are not allowed in strict mode.
~~~~~~~~~~~
!!! error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'.
}
/** @typedef {{ n: string }} N */
switch (name) {
}
/** @typedef {{ o: string }} O */
fork: while (false) {
}
/** @typedef {{ p: string }} P */
throw new Error('Unreachable')
/** @typedef {{ q: string }} Q */
try {
}
catch (e) {
}
/**
* @param {A} a
* @param {B} b
* @param {C} c
* @param {D} d
* @param {E} e
* @param {F} f
* @param {G} g
* @param {H} h
* @param {I} i
* @param {J} j
* @param {K} k
* @param {L} l
* @param {M} m
* @param {N} n
* @param {O} o
* @param {P} p
* @param {Q} q
*/
function proof (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q) {
console.log(a.a, b.b, c.c, d.d, e.e, f.f, g.g, h.h, i.i, j.j, k.k, l.l, m.m, n.n, o.o, p.p, q.q)
/** @type {Alpha} */
var alpha = { alpha: "aleph" }
/** @typedef {{ alpha: string }} Alpha */
return
}