I am trying to create an instance of a class, but the compile-time error is saying:
Cannot create an instance of the abstract class 'QueueProcess'.
However, I am not creating an instance of it, I am creating an an instance of a class that extends QueueProcess. So, why am I getting this error?
export class Queue<T extends QueueProcess> {
private _queue: T[] = []
private async runFirstProcess() {
let process = new this._queue[0]
}
}
export abstract class QueueProcess {
}
The code once compiled works fine, it is just throwing that compile-time error.
export class Queue extends QueueProcess implements T. It seems really weird while you are using that "arrows" around extendsQueuedoesn't extendQueueProcess, it holds an array ofQueueProcess's