🔎 Search Terms
type alias inlined regression 5.5
🕗 Version & Regression Information
- This changed between versions 5.5.0-dev.20240514 and 5.5.0-dev.20240515
⏯ Playground Link
Workbench
💻 Code
// @declaration: true
// @filename: a.ts
type O = {
prop: string
prop2: string
}
type I = {
prop: string
}
export const fn = (v: O['prop'], o: Omit<O, keyof I>) => {};
// @filename: b.ts
import {fn} from './a'
export const f = fn;
🙁 Actual behavior
O['prop'] is written in declaration file as { prop: string; prop2: string; }[prop"]. And Omit<O, keyof I> is printed as Omit<{ prop: string; prop2: string; }, keyof { prop: string; }>
This is problematic especially if the type is a bigger as it balloon the size of the printed type and it may pull in references that were not previously used (causing new errors)
🙂 Expected behavior
O['prop'] is written in declaration file as string as O and Omit<O, keyof I> is printed as Omit<O, 'prop'> as in 5.4 since O and I can't be named
Additional information about the issue
No response