Closed
Description
Consider a.d.ts
(which compiles fine in isolation) without any error:
declare module "foo" {
interface Foo {
a: number;
}
var _:Foo;
export = _;
}
And b.d.ts
that plans to add stuff to module foo
's Foo
interface:
/// <reference path="./a"/>
declare module "foo" {
interface Foo {
b: number;
}
}
With this we have two errors:
a.d.ts
gets an error onexport =
"An export assignment cannot be used in a module with other exported elements.b.d.ts
doesn't actually manage to add to theinterface Foo
as demonstrated by a test filetest.ts
:
/// <reference path="./a"/>
/// <reference path="./b"/>
import foo = require("foo");
foo.b = 123; // ERROR: Property b to not exist on type Foo
Discovered in DefinitelyTyped : DefinitelyTyped/DefinitelyTyped#4101 /cc @vvakame