2015-02-03 00:15:54 +01:00
|
|
|
//// [classWithOptionalParameter.ts]
|
|
|
|
// classes do not permit optional parameters, these are errors
|
|
|
|
|
|
|
|
class C {
|
|
|
|
x?: string;
|
|
|
|
f?() {}
|
|
|
|
}
|
|
|
|
|
|
|
|
class C2<T> {
|
|
|
|
x?: T;
|
|
|
|
f?(x: T) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
//// [classWithOptionalParameter.js]
|
|
|
|
// classes do not permit optional parameters, these are errors
|
|
|
|
var C = (function () {
|
|
|
|
function C() {
|
|
|
|
}
|
2015-02-07 03:45:09 +01:00
|
|
|
C.prototype.f = function () { };
|
2015-02-03 00:15:54 +01:00
|
|
|
return C;
|
|
|
|
})();
|
|
|
|
var C2 = (function () {
|
|
|
|
function C2() {
|
|
|
|
}
|
2015-02-07 03:45:09 +01:00
|
|
|
C2.prototype.f = function (x) { };
|
2015-02-03 00:15:54 +01:00
|
|
|
return C2;
|
|
|
|
})();
|