Skip to content

Stack overflow in getTypePredicateOfSignature #37265

@minestarks

Description

@minestarks

TypeScript Version: 3.7.5

Search Terms: crash jsdoc tag template typedef

Code

crashit.js:

// @ts-check

/**
* @template TIterEntry
* @callback IterablePredicate
**/
/** @type {IterablePredicate<number>} */
let x
x(3)
x("a")
tsc --allowJs --noEmit crashit.js

Expected behavior:
no crash

Actual behavior:


RangeError: Maximum call stack size exceeded
    at getJSDocTags (/usr/local/lib/node_modules/typescript/lib/tsc.js:11614:26)
    at getFirstJSDocTag (/usr/local/lib/node_modules/typescript/lib/tsc.js:11625:24)
    at Object.getJSDocTypeTag (/usr/local/lib/node_modules/typescript/lib/tsc.js:11581:19)
    at getSignatureOfTypeTag (/usr/local/lib/node_modules/typescript/lib/tsc.js:34795:52)
    at getTypePredicateOfSignature (/usr/local/lib/node_modules/typescript/lib/tsc.js:34877:46)
    at getTypePredicateOfSignature (/usr/local/lib/node_modules/typescript/lib/tsc.js:34867:47)
    at getTypePredicateOfSignature (/usr/local/lib/node_modules/typescript/lib/tsc.js:34879:46)
    at getTypePredicateOfSignature (/usr/local/lib/node_modules/typescript/lib/tsc.js:34867:47)
    at getTypePredicateOfSignature (/usr/local/lib/node_modules/typescript/lib/tsc.js:34879:46)
    at getTypePredicateOfSignature (/usr/local/lib/node_modules/typescript/lib/tsc.js:34867:47)

Playground Link: Playground Link

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions