Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ts-5.5] Private aliases expanded in index and keyof types - 5.5 regression #58713

Closed
dragomirtitian opened this issue May 30, 2024 · 0 comments Β· Fixed by #58715
Closed

[ts-5.5] Private aliases expanded in index and keyof types - 5.5 regression #58713

dragomirtitian opened this issue May 30, 2024 · 0 comments Β· Fixed by #58715

Comments

@dragomirtitian
Copy link
Contributor

πŸ”Ž 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant