-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Labels
bugSomething isn't workingSomething isn't working
Description
If we had an interface for example:
interface Animal{
walk(): void;
}And then we have a class like:
class Main {
private animals = [new Dog(), new Cat()];
randomWalk() {
const index = Math.round(Math.random());
const animal = this.animals[index];
// This doesn't work
animal.walk();
}
}Then animal.walk will not work at all. The compiler completely skips it since it sees just an interface and not a concrete class.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working