TypeScript/tests/cases/conformance/jsdoc/typedefInnerNamepaths.ts
Nathan Shively-Sanders 43d0794ba3
Fix crash when binding jsdoc-style inner namepaths (#25106)
* getDeclarationIdentifier handles undefined name

getNameOfDeclaration actually doesn't handle all declarations, only
those that produce names that could be reasonably used as an identifier.
Until now, getDeclarationIdentifier assumed that getNameOfDeclaration
always returned a name. This caused crashes whenever we tried to get the
name of something like a Constructor.

* Add test and baselines

* getNameOfDeclaration can return undefined

This requires all callers to handle it, which turns out now to be too
disruptive.

* Fix lint
2018-06-21 10:01:39 -07:00

14 lines
215 B
TypeScript

// @noEmit: true
// @allowJs: true
// @checkJs: true
// @Filename: bug25104.js
class C {
/**
* @typedef {C~A} C~B
* @typedef {object} C~A
*/
/** @param {C~A} o */
constructor(o) {
}
}