Skip to content

TS3.7 regression: renamed exports in namespaces do not resolve in nested namespaces #34612

@mprobst

Description

@mprobst

TypeScript Version: 3.7.0-beta

Search Terms: namespace renamed export

Code

export declare const x: number;
declare global {
  namespace clutz {
    export {x as some$mangled$name$x};
  }
  namespace clutz.some$mangled$name {
    export {some$mangled$name$x as x};
  }
}

(Using the mangled alias name some$mangled$name$x instead of x makes sure that no other symbol in the namespace accidentally shadows the outer x.)

Expected behavior:

In TypeScript 3.6, some$mangled$name$x within the nested namespace clutz.some$mangled$name resolves to export {x as clutz.some$mangled$name$x} in the parent namespace, and thus eventually to x.

Actual behavior:

In TypeScript 3.7, some$mangled$name$x does not resolve in the nested namespace.

Playground Link: (no 3.7 playground around)

Related Issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions