TypeScript/tests/cases/conformance/jsdoc/typedefTagTypeResolution.ts
Nathan Shively-Sanders 6450490844
Fix jsdoc type resolution [merge to master] (#24204)
* Fix JSDoc type resolution

Breaks type parameter resolution that is looked up through prototype
methods, though. I need to fix that still.

* Check for prototype method assignments first

* Undo dedupe changes to getJSDocTags

* JS Type aliases can't refer to host type params

Previously, js type aliases (@typedef and @callback) could refer to
type paremeters defined in @template tags in a *different* jsdoc tag, as
long as both tags were hosted on the same signature.

* Reduce dedupe changes+update baseline

The only reason I had undone them was to merge successfully with an
older state of master.
2018-05-17 10:46:10 -07:00

33 lines
467 B
TypeScript

// @noEmit: true
// @allowJs: true
// @checkJs: true
// @Filename: github20832.js
// #20832
/** @typedef {U} T - should be "error, can't find type named 'U' */
/**
* @template U
* @param {U} x
* @return {T}
*/
function f(x) {
return x;
}
/** @type T - should be fine, since T will be any */
const x = 3;
/**
* @callback Cb
* @param {V} firstParam
*/
/**
* @template V
* @param {V} vvvvv
*/
function g(vvvvv) {
}
/** @type {Cb} */
const cb = x => {}