2014-07-13 01:04:16 +02:00
|
|
|
//// [optionalConstructorArgInSuper.ts]
|
|
|
|
class Base {
|
|
|
|
constructor(opt?) { }
|
|
|
|
foo(other?) { }
|
|
|
|
}
|
|
|
|
class Derived extends Base {
|
|
|
|
}
|
|
|
|
var d = new Derived(); // bug caused an error here, couldn't select overload
|
|
|
|
var d2: Derived;
|
|
|
|
d2.foo();
|
|
|
|
|
|
|
|
|
|
|
|
//// [optionalConstructorArgInSuper.js]
|
2015-05-01 19:49:54 +02:00
|
|
|
var __extends = (this && this.__extends) || function (d, b) {
|
2014-07-13 01:04:16 +02:00
|
|
|
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
|
|
function __() { this.constructor = d; }
|
|
|
|
__.prototype = b.prototype;
|
|
|
|
d.prototype = new __();
|
|
|
|
};
|
|
|
|
var Base = (function () {
|
|
|
|
function Base(opt) {
|
|
|
|
}
|
2015-03-26 21:46:35 +01:00
|
|
|
Base.prototype.foo = function (other) { };
|
2014-07-13 01:04:16 +02:00
|
|
|
return Base;
|
|
|
|
})();
|
|
|
|
var Derived = (function (_super) {
|
|
|
|
__extends(Derived, _super);
|
|
|
|
function Derived() {
|
|
|
|
_super.apply(this, arguments);
|
|
|
|
}
|
|
|
|
return Derived;
|
|
|
|
})(Base);
|
2014-08-15 22:18:54 +02:00
|
|
|
var d = new Derived(); // bug caused an error here, couldn't select overload
|
2014-07-13 01:04:16 +02:00
|
|
|
var d2;
|
|
|
|
d2.foo();
|