TypeScript/tests/cases/conformance/jsdoc/typeTagPrototypeAssignment.ts
Nathan Shively-Sanders 53bb4e84a2
Better checking of assignment declarations (#28387)
Previously, type checking was turned off for all assignment
declarations. This is a problem when the declarations are annotated with
jsdoc types.

This PR checks assignment declarations, *except* for expando
initialisers. Expando initialisers are

1. Empty object types.
2. Function types.
3. Class types.
4. Non-empty object types when the assignment declaration kind is
prototype assignment or module.exports assignment.
2018-11-15 08:46:11 -08:00

9 lines
135 B
TypeScript

// @Filename: bug27327.js
// @noEmit: true
// @allowJs: true
// @checkJs: true
function C() {
}
/** @type {string} */
C.prototype = 12