Skip to content

Typescript gets confused with a variable and an imported interface with the same name #7368

@louy

Description

@louy

TypeScript Version:
1.8.0-1.8.7

Code

import {Key} from 'types'; // Key is an interface
const Key = { test() {} };
Key.test();
export default Key;

Expected behavior:

Key.test();
exports.default = Key;

Actual behavior:

types_1.Key.test();
exports.default = types_1.Key;

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