In my Typescript code, I have a small implementation where a class is either implementing an interface or extending another class.
interface ITest {
run(id: number): void
}
abstract class Test implements ITest {
abstract run(id);
}
class TestExtension extends Test
{
constructor() {
super();
}
public run(id) { }
}
class TestImplementation implements ITest {
constructor() {
}
public run(id) { }
}
However, both implementations show incorrect Intellisense suggestions with the 'id' parameter being of type 'any' instead of 'number':
(method) TestExtension.run(id: any): void
(method) TestImplementation.run(id: any): void
One solution could be to explicitly set the method implementation as public(id: number) { }
, but I find this unnecessary. Can someone please explain why this is happening?