TypeScript/tests/cases/conformance/jsdoc/jsdocImplements_class.ts
Nathan Shively-Sanders 392fd0ac0b
Remove bogus @implements errors (#37114)
* Remove bogus @implements errors

Make the search for the actual host more comprehensive by reusing the
code that previously only searched for functions. I don't know what to
call this function now, since the old name wasn't accurate either.

* undo gratuitous name change

* Improve name and make calling more uniform

It's slightly less efficient but I think worthwhile for readability.
2020-03-02 09:48:53 -08:00

59 lines
910 B
TypeScript

// @allowJs: true
// @checkJs: true
// @declaration: true
// @emitDeclarationOnly: true
// @outDir: ./out
// @Filename: /a.js
class A {
/** @return {number} */
method() { throw new Error(); }
}
/** @implements {A} */
class B {
method() { return 0 }
}
/** @implements A */
class B2 {
/** @return {string} */
method() { return "" }
}
/** @implements {A} */
class B3 {
}
var Ns = {};
/** @implements {A} */
Ns.C1 = class {
method() { return 11; }
}
/** @implements {A} */
var C2 = class {
method() { return 12; }
}
var o = {
/** @implements {A} */
C3: class {
method() { return 13; }
}
}
class CC {
/** @implements {A} */
C4 = class {
method() {
return 14;
}
}
}
var C5;
/** @implements {A} */
Ns.C5 = C5 || class {
method() {
return 15;
}
}