Accepted baselines.

This commit is contained in:
Daniel Rosenwasser 2016-12-14 12:53:19 -08:00
parent dd0a3809d6
commit a01c195b4b
4 changed files with 100 additions and 0 deletions

View file

@ -0,0 +1,17 @@
tests/cases/compiler/captureSuperPropertyAccessInSuperCall01.ts(9,24): error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class.
==== tests/cases/compiler/captureSuperPropertyAccessInSuperCall01.ts (1 errors) ====
class A {
constructor(f: () => string) {
}
public blah(): string { return ""; }
}
class B extends A {
constructor() {
super(() => { return super.blah(); })
~~~~~
!!! error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class.
}
}

View file

@ -0,0 +1,33 @@
//// [captureSuperPropertyAccessInSuperCall01.ts]
class A {
constructor(f: () => string) {
}
public blah(): string { return ""; }
}
class B extends A {
constructor() {
super(() => { return super.blah(); })
}
}
//// [captureSuperPropertyAccessInSuperCall01.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 A = (function () {
function A(f) {
}
A.prototype.blah = function () { return ""; };
return A;
}());
var B = (function (_super) {
__extends(B, _super);
function B() {
var _this = _super.call(this, function () { return _super.blah.call(_this); }) || this;
return _this;
}
return B;
}(A));

View file

@ -0,0 +1,17 @@
tests/cases/compiler/superPropertyAccessInSuperCall01.ts(9,9): error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class.
==== tests/cases/compiler/superPropertyAccessInSuperCall01.ts (1 errors) ====
class A {
constructor(f: string) {
}
public blah(): string { return ""; }
}
class B extends A {
constructor() {
super(super.blah())
~~~~~
!!! error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class.
}
}

View file

@ -0,0 +1,33 @@
//// [superPropertyAccessInSuperCall01.ts]
class A {
constructor(f: string) {
}
public blah(): string { return ""; }
}
class B extends A {
constructor() {
super(super.blah())
}
}
//// [superPropertyAccessInSuperCall01.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 A = (function () {
function A(f) {
}
A.prototype.blah = function () { return ""; };
return A;
}());
var B = (function (_super) {
__extends(B, _super);
function B() {
var _this = _super.call(this, _super.blah.call(_this)) || this;
return _this;
}
return B;
}(A));