Box tests
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Julien Valverdé
2024-02-24 04:10:01 +01:00
parent 9e18a4a0ee
commit 7da3d50bcc

View File

@@ -51,25 +51,28 @@ const subInst = await SubTest.createPromise({ name: "", prout: "" })
// console.log(subInst)
class BaseClass {
declare ["constructor"]: typeof BaseClass
static readonly issou = "gneugneu"
class Box<T> {
declare ["constructor"]: typeof Box
constructor(public value: T) {}
otherMethod() {
return "prout" as const
}
method<I extends object>(
this: Omit<BaseClass, "constructor"> & { ["constructor"]: Class<I> }
method<
C extends typeof Box & Class<I>,
I extends Box<any>
>(
// this: Omit<BaseClass<T>, "constructor"> & { ["constructor"]: Class<I> }
this: { ["constructor"]: C }
) {
this.otherMethod()
return new this.constructor()
// this.otherMethod()
return new this.constructor(69)
}
}
class Superclass extends BaseClass {
declare ["constructor"]: typeof Superclass
class SuperBox<T> extends Box<T> {
declare ["constructor"]: typeof SuperBox
}
console.log(new Superclass().method())