mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
55 lines
1.7 KiB
TypeScript
55 lines
1.7 KiB
TypeScript
//// [tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts] ////
|
|
|
|
//// [ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts]
|
|
class Point {
|
|
constructor(public x: number, public y: number) { }
|
|
|
|
static Origin(): Point { return { x: 0, y: 0 }; } // unexpected error here bug 840246
|
|
}
|
|
|
|
namespace Point {
|
|
export function Origin() { return null; } //expected duplicate identifier error
|
|
}
|
|
|
|
|
|
namespace A {
|
|
export class Point {
|
|
constructor(public x: number, public y: number) { }
|
|
|
|
static Origin(): Point { return { x: 0, y: 0 }; } // unexpected error here bug 840246
|
|
}
|
|
|
|
export namespace Point {
|
|
export function Origin() { return ""; }//expected duplicate identifier error
|
|
}
|
|
}
|
|
|
|
//// [ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.js]
|
|
"use strict";
|
|
class Point {
|
|
constructor(x, y) {
|
|
this.x = x;
|
|
this.y = y;
|
|
}
|
|
static Origin() { return { x: 0, y: 0 }; } // unexpected error here bug 840246
|
|
}
|
|
(function (Point) {
|
|
function Origin() { return null; } //expected duplicate identifier error
|
|
Point.Origin = Origin;
|
|
})(Point || (Point = {}));
|
|
var A;
|
|
(function (A) {
|
|
class Point {
|
|
constructor(x, y) {
|
|
this.x = x;
|
|
this.y = y;
|
|
}
|
|
static Origin() { return { x: 0, y: 0 }; } // unexpected error here bug 840246
|
|
}
|
|
A.Point = Point;
|
|
(function (Point) {
|
|
function Origin() { return ""; } //expected duplicate identifier error
|
|
Point.Origin = Origin;
|
|
})(Point = A.Point || (A.Point = {}));
|
|
})(A || (A = {}));
|