From ae559a7ccf06993d849e0e34e20c5d2efed2e763 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Thu, 3 Dec 2015 15:51:15 -0800 Subject: [PATCH] Add test and accept baselines --- .../extendConstructSignatureInInterface.js | 27 +++++++++++++++++++ ...xtendConstructSignatureInInterface.symbols | 23 ++++++++++++++++ .../extendConstructSignatureInInterface.types | 25 +++++++++++++++++ .../extendConstructSignatureInInterface.ts | 9 +++++++ 4 files changed, 84 insertions(+) create mode 100644 tests/baselines/reference/extendConstructSignatureInInterface.js create mode 100644 tests/baselines/reference/extendConstructSignatureInInterface.symbols create mode 100644 tests/baselines/reference/extendConstructSignatureInInterface.types create mode 100644 tests/cases/compiler/extendConstructSignatureInInterface.ts diff --git a/tests/baselines/reference/extendConstructSignatureInInterface.js b/tests/baselines/reference/extendConstructSignatureInInterface.js new file mode 100644 index 00000000000..c440872a566 --- /dev/null +++ b/tests/baselines/reference/extendConstructSignatureInInterface.js @@ -0,0 +1,27 @@ +//// [extendConstructSignatureInInterface.ts] +interface C { + new(x: number): C; +} + +var CStatic: C; +class E extends CStatic { +} + +var e: E = new E(1); + + +//// [extendConstructSignatureInInterface.js] +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var CStatic; +var E = (function (_super) { + __extends(E, _super); + function E() { + _super.apply(this, arguments); + } + return E; +})(CStatic); +var e = new E(1); diff --git a/tests/baselines/reference/extendConstructSignatureInInterface.symbols b/tests/baselines/reference/extendConstructSignatureInInterface.symbols new file mode 100644 index 00000000000..df966bc9fcc --- /dev/null +++ b/tests/baselines/reference/extendConstructSignatureInInterface.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/extendConstructSignatureInInterface.ts === +interface C { +>C : Symbol(C, Decl(extendConstructSignatureInInterface.ts, 0, 0)) + + new(x: number): C; +>x : Symbol(x, Decl(extendConstructSignatureInInterface.ts, 1, 8)) +>C : Symbol(C, Decl(extendConstructSignatureInInterface.ts, 0, 0)) +} + +var CStatic: C; +>CStatic : Symbol(CStatic, Decl(extendConstructSignatureInInterface.ts, 4, 3)) +>C : Symbol(C, Decl(extendConstructSignatureInInterface.ts, 0, 0)) + +class E extends CStatic { +>E : Symbol(E, Decl(extendConstructSignatureInInterface.ts, 4, 15)) +>CStatic : Symbol(CStatic, Decl(extendConstructSignatureInInterface.ts, 4, 3)) +} + +var e: E = new E(1); +>e : Symbol(e, Decl(extendConstructSignatureInInterface.ts, 8, 3)) +>E : Symbol(E, Decl(extendConstructSignatureInInterface.ts, 4, 15)) +>E : Symbol(E, Decl(extendConstructSignatureInInterface.ts, 4, 15)) + diff --git a/tests/baselines/reference/extendConstructSignatureInInterface.types b/tests/baselines/reference/extendConstructSignatureInInterface.types new file mode 100644 index 00000000000..363107b2e54 --- /dev/null +++ b/tests/baselines/reference/extendConstructSignatureInInterface.types @@ -0,0 +1,25 @@ +=== tests/cases/compiler/extendConstructSignatureInInterface.ts === +interface C { +>C : C + + new(x: number): C; +>x : number +>C : C +} + +var CStatic: C; +>CStatic : C +>C : C + +class E extends CStatic { +>E : E +>CStatic : C +} + +var e: E = new E(1); +>e : E +>E : E +>new E(1) : E +>E : typeof E +>1 : number + diff --git a/tests/cases/compiler/extendConstructSignatureInInterface.ts b/tests/cases/compiler/extendConstructSignatureInInterface.ts new file mode 100644 index 00000000000..a0880de69cd --- /dev/null +++ b/tests/cases/compiler/extendConstructSignatureInInterface.ts @@ -0,0 +1,9 @@ +interface C { + new(x: number): C; +} + +var CStatic: C; +class E extends CStatic { +} + +var e: E = new E(1);