Skip to content

Imported namespaces aren't recognized in --checkJs #16489

Closed
@Zarel

Description

@Zarel

TypeScript Version: nightly (2.5.0-dev.20170613)

Code

test-externclassdef.js

class Foo {
  constructor() {}
}

exports.Foo = Foo;

test-externclass.js

const {Foo} = require('./test-externclassdef');
const Stuff = require('./test-externclassdef');

// this works now
/** @type {Foo} */
let a = new Foo();

// this is still an error
/** @type {Stuff.Foo} */
let b = new Stuff.Foo();

Expected behavior:
No error

Actual behavior:

test-externclass.js(9,12): error TS2503: Cannot find namespace 'Stuff'.

#16316 fixes the first kind of import (which I'm really thankful for), but the second kind is still an error.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions