Skip to content

Bad error message when importing empty namespace #15155

Description

@evmar

In foo.d.ts:

declare module 'x' {
  namespace z {}
  export = z;
}

In bar.ts:

import * as foo from 'x';
foo.bar();

Running tsc (2.2):

bar.ts(2,1): error TS2304: Cannot find name 'foo'.

I think foo exists, it's really just missing a bar attribute?

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: Error MessagesThe issue relates to error messagingFixedA PR has been merged for this issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions