Skip to content

Inconsistent namespace output between tsgo and tsc #1081

@magic-akari

Description

@magic-akari

Input

namespace ns {
  a = 1;
}

namespace ns {
  export declare var a: number;
}

tsc output

"use strict";
var ns;
(function (ns) {
    ns.a = 1;
})(ns || (ns = {}));
(function (ns) {
})(ns || (ns = {}));

tsgo output

var ns;
(function (ns) {
    a = 1;
})(ns || (ns = {}));
(function (ns) {
})(ns || (ns = {}));

context

expected behavior

One of the following should happen:

  • disallow partial namespace in tsgo
  • fix the tsgo output to match the tsc output

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions