Skip to content

Commit a01c195

Browse files
Accepted baselines.
1 parent dd0a380 commit a01c195

File tree

4 files changed

+100
-0
lines changed

4 files changed

+100
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
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.
2+
3+
4+
==== tests/cases/compiler/captureSuperPropertyAccessInSuperCall01.ts (1 errors) ====
5+
class A {
6+
constructor(f: () => string) {
7+
}
8+
public blah(): string { return ""; }
9+
}
10+
11+
class B extends A {
12+
constructor() {
13+
super(() => { return super.blah(); })
14+
~~~~~
15+
!!! error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class.
16+
}
17+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
//// [captureSuperPropertyAccessInSuperCall01.ts]
2+
class A {
3+
constructor(f: () => string) {
4+
}
5+
public blah(): string { return ""; }
6+
}
7+
8+
class B extends A {
9+
constructor() {
10+
super(() => { return super.blah(); })
11+
}
12+
}
13+
14+
//// [captureSuperPropertyAccessInSuperCall01.js]
15+
var __extends = (this && this.__extends) || function (d, b) {
16+
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
17+
function __() { this.constructor = d; }
18+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
19+
};
20+
var A = (function () {
21+
function A(f) {
22+
}
23+
A.prototype.blah = function () { return ""; };
24+
return A;
25+
}());
26+
var B = (function (_super) {
27+
__extends(B, _super);
28+
function B() {
29+
var _this = _super.call(this, function () { return _super.blah.call(_this); }) || this;
30+
return _this;
31+
}
32+
return B;
33+
}(A));
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
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.
2+
3+
4+
==== tests/cases/compiler/superPropertyAccessInSuperCall01.ts (1 errors) ====
5+
class A {
6+
constructor(f: string) {
7+
}
8+
public blah(): string { return ""; }
9+
}
10+
11+
class B extends A {
12+
constructor() {
13+
super(super.blah())
14+
~~~~~
15+
!!! error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class.
16+
}
17+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
//// [superPropertyAccessInSuperCall01.ts]
2+
class A {
3+
constructor(f: string) {
4+
}
5+
public blah(): string { return ""; }
6+
}
7+
8+
class B extends A {
9+
constructor() {
10+
super(super.blah())
11+
}
12+
}
13+
14+
//// [superPropertyAccessInSuperCall01.js]
15+
var __extends = (this && this.__extends) || function (d, b) {
16+
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
17+
function __() { this.constructor = d; }
18+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
19+
};
20+
var A = (function () {
21+
function A(f) {
22+
}
23+
A.prototype.blah = function () { return ""; };
24+
return A;
25+
}());
26+
var B = (function (_super) {
27+
__extends(B, _super);
28+
function B() {
29+
var _this = _super.call(this, _super.blah.call(_this)) || this;
30+
return _this;
31+
}
32+
return B;
33+
}(A));

0 commit comments

Comments
 (0)