Skip to content

Type and module imports of the same name shouldn't fail with "duplicate identifier"Β #48764

Closed
@samhh

Description

@samhh

Bug Report

πŸ”Ž Search Terms

  • import type
  • duplicate identifier
  • namespace
  • type
  • value

πŸ•— Version & Regression Information

This is the behavior in every version I tried, and I reviewed the FAQ for entries about import type.

⏯ Playground Link

I don't think this is possible to demonstrate in the playground as it needs a module to import * from?

πŸ’» Code

// Works
import type { T } from 'foo'
declare const T: any

// Doesn't work, but should
import type { T } from 'foo'
import * as T from 'bar'

πŸ™ Actual behavior

Duplicate identifier 'T'.

πŸ™‚ Expected behavior

The compiler should recognise that one identifier is a type and the other a value and allow the two to coexist, as it does in other scenarios.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions