TypeScript/tests/baselines/reference/classAbstractOverrideWithAbstract.js
2020-12-01 19:03:49 -05:00

84 lines
2.2 KiB
TypeScript

//// [classAbstractOverrideWithAbstract.ts]
class A {
foo() {}
}
abstract class B extends A {
abstract foo();
}
abstract class AA {
foo() {}
abstract bar();
}
abstract class BB extends AA {
abstract foo();
bar () {}
}
class CC extends BB {} // error
class DD extends BB {
foo() {}
}
//// [classAbstractOverrideWithAbstract.js]
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var A = /** @class */ (function () {
function A() {
}
A.prototype.foo = function () { };
return A;
}());
var B = /** @class */ (function (_super) {
__extends(B, _super);
function B() {
return _super !== null && _super.apply(this, arguments) || this;
}
return B;
}(A));
var AA = /** @class */ (function () {
function AA() {
}
AA.prototype.foo = function () { };
return AA;
}());
var BB = /** @class */ (function (_super) {
__extends(BB, _super);
function BB() {
return _super !== null && _super.apply(this, arguments) || this;
}
BB.prototype.bar = function () { };
return BB;
}(AA));
var CC = /** @class */ (function (_super) {
__extends(CC, _super);
function CC() {
return _super !== null && _super.apply(this, arguments) || this;
}
return CC;
}(BB)); // error
var DD = /** @class */ (function (_super) {
__extends(DD, _super);
function DD() {
return _super !== null && _super.apply(this, arguments) || this;
}
DD.prototype.foo = function () { };
return DD;
}(BB));