Skip to content

[ts-5.5-rc] Import elided in spite of being use in declarationsΒ #58749

@dragomirtitian

Description

@dragomirtitian

πŸ”Ž Search Terms

import elided declarations

πŸ•— Version & Regression Information

  • This changed between versions 5.5-beta and 5.5-rc

⏯ Playground Link

Workbench

πŸ’» Code

// @declaration: true
// @filename: utils.ts
export interface Evt { }


// @filename: decl.ts
import {Evt} from './utils'
export const o = <T>(o: T) => () : T => null!

// @filename: main.ts
import { o }  from './decl'
import { Evt }  from './utils'

export const f = { o: o({ v: null! as Evt}) };

πŸ™ Actual behavior

main.d.ts contains f: { o: () => { v: Evt; }; } but the import for Evt is elided from the declaration file.

πŸ™‚ Expected behavior

Evt should be preserved in the declaration file.

Additional information about the issue

No response

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions