TypeScript Version: 3.7.2
Search Terms:
Code
// @target: es6
class Base {
method?() { }
}
Expected behavior:
"use strict";
class Base {
method() { }
}
Actual behavior:
"use strict";
class Base {
method?() { }
}
Playground Link: http://www.typescriptlang.org/play/?target=2&ssl=3&ssc=2&pln=1&pc=1#code/MYGwhgzhAEBCkFNoG8BQ0PQLYIC4AsB7AEwH4AKAShWgF9V6g
Somehow this isn't a regression?!?!?!?
As far back as 2.4.1!
Holy shit!
I've never considered writing such a construct before...
Every time I've needed an "optional method", I would use,
class Base {
method? : () => T
}