Closed
Description
TypeScript Version: [email protected] (also 2.4 and 2.5)
Code
// extra.ts
export var x = 3;
// iface.d.ts
import {x} from './extra';
// note: this next line is *not* exported
declare interface Foo { bar: string; }
// user.ts
import {Foo} from './iface';
Expected behavior:
This should fail to compile, because iface.d.ts
did not export the Foo
type. Error message should be
error TS2305: Module ... has no exported member 'Foo'.
Actual behavior:
It compiles.
Extra notes:
- if iface.d.ts has no import statement, but instead uses
export {}
to become a module, then expected error is produced - if you remove import/export statements from iface.d.ts, then as expected you get the 'is not a module' error
- if you rename iface.d.ts to iface.ts, then expected error is produced