Skip to content

Access through dynamic import doesn't contribute to "reference" #41472

@Jack-Works

Description

@Jack-Works

TypeScript Version: 4.2.0.dev.20201108

Search Terms: dynamic import file module

Code

test.ts

export function hey() {}
const t = import('./test')
t.then((x) => x.hey)

If you rename hey, test2.ts won't be renamed. And hey reports 0 references on it.

But strangely if I change it to

const t = import('./test')

t.then((x) => x.a)
import * as q from './test'

It works now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions