Bug Report
🔎 Search Terms
"No error for last overload signature" yields stale issue 35186, and a couple of more recent issues that got resolved: 48636, 37974. (The stale 35186 appears to be a different issue as it also occurs in versions before v5.0.4.)
🕗 Version & Regression Information
- This is a crash
- This changed between versions 4.9.5 and 5.0.4, and still occurs up to typescript@next.
⏯ Playground Link
Bug-workbench link with relevant code
💻 Code
// @filename: types.tsexporttypeProductName='a'|'b'exporttypeSubproductNameForProductName<PextendsProductName>=Pextendsunknown
? keyofEntitiesByProductName[P]
: nevertypeEntitiesByProductName={a: {a1: {value: 'a-a1'}}b: {b1: {value: 'b-b1'}}}exporttypeDiscriminatedUnion<PextendsProductName=ProductName,EextendsSubproductNameForProductName<P>=SubproductNameForProductName<P>,>=PextendsProductName
? EextendsSubproductNameForProductName<P>// ? E extends unknown // With unknown, the exception doesn't happen.
? EntitiesByProductName[P][E]
: never
: never// @filename: app.tsimport{SubproductNameForProductName,DiscriminatedUnion,ProductName}from'./types'exportconstbug=<PextendsProductName>()=>{constsubproducts: DiscriminatedUnion<P,SubproductNameForProductName<P>>[]=[]subproducts.map((_: DiscriminatedUnion)=>null)}🙁 Actual behavior
The compiler throws an exception:
/Users/martijn/git/Insify/insify-core/node_modules/typescript/lib/tsc.js:114747
throw e;
^
Error: Debug Failure. No error for last overload signature
at resolveCall (/Users/martijn/git/Insify/insify-core/node_modules/typescript/lib/tsc.js:70223:19)
at resolveCallExpression (/Users/martijn/git/Insify/insify-core/node_modules/typescript/lib/tsc.js:70605:12)
at resolveSignature (/Users/martijn/git/Insify/insify-core/node_modules/typescript/lib/tsc.js:70988:16)
at getResolvedSignature (/Users/martijn/git/Insify/insify-core/node_modules/typescript/lib/tsc.js:71008:18)
at checkCallExpression (/Users/martijn/git/Insify/insify-core/node_modules/typescript/lib/tsc.js:71120:23)
at checkExpressionWorker (/Users/martijn/git/Insify/insify-core/node_modules/typescript/lib/tsc.js:74278:16)
at checkExpression (/Users/martijn/git/Insify/insify-core/node_modules/typescript/lib/tsc.js:74189:32)
at maybeCheckExpression (/Users/martijn/git/Insify/insify-core/node_modules/typescript/lib/tsc.js:73280:28)
at BinaryExpressionStateMachine.onLeft (/Users/martijn/git/Insify/insify-core/node_modules/typescript/lib/tsc.js:73216:16)
at Array.left (/Users/martijn/git/Insify/insify-core/node_modules/typescript/lib/tsc.js:25140:30)
🙂 Expected behavior
No compiler exception.
Bug Report
🔎 Search Terms
"No error for last overload signature" yields stale issue 35186, and a couple of more recent issues that got resolved: 48636, 37974. (The stale 35186 appears to be a different issue as it also occurs in versions before v5.0.4.)
🕗 Version & Regression Information
⏯ Playground Link
Bug-workbench link with relevant code
💻 Code
🙁 Actual behavior
The compiler throws an exception:
🙂 Expected behavior
No compiler exception.