Skip to content

Missing error for local interface merging with exported variable #16596

@ajafff

Description

@ajafff

TypeScript Version: 2.4.0

Code

Noticed this in https://github.com/Microsoft/TypeScript/blob/master/src/harness/fourslash.ts#L4128

interface Foo { bar: number }
export namespace Foo {
    export let baz = 1;
}

same with variable instead of namespace

interface Foo { bar: number }
export var Foo = {
    baz: 1,
};

Expected behavior:
Individual declarations in merged declaration 'Foo' must be all exported or all local.

Actual behavior:
No error.

If I use a TypeAlias or class instead of the interface, it works as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptInfrastructureIssue relates to TypeScript team infrastructure

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions