|
| 1 | +=== tests/cases/compiler/mixinIntersectionIsValidbaseType.ts === |
| 2 | +export type Constructor<T extends object = object> = new (...args: any[]) => T; |
| 3 | +>Constructor : Symbol(Constructor, Decl(mixinIntersectionIsValidbaseType.ts, 0, 0)) |
| 4 | +>T : Symbol(T, Decl(mixinIntersectionIsValidbaseType.ts, 0, 24)) |
| 5 | +>args : Symbol(args, Decl(mixinIntersectionIsValidbaseType.ts, 0, 58)) |
| 6 | +>T : Symbol(T, Decl(mixinIntersectionIsValidbaseType.ts, 0, 24)) |
| 7 | + |
| 8 | +export interface Initable { |
| 9 | +>Initable : Symbol(Initable, Decl(mixinIntersectionIsValidbaseType.ts, 0, 79)) |
| 10 | + |
| 11 | + init(...args: any[]): void; |
| 12 | +>init : Symbol(Initable.init, Decl(mixinIntersectionIsValidbaseType.ts, 2, 27)) |
| 13 | +>args : Symbol(args, Decl(mixinIntersectionIsValidbaseType.ts, 3, 9)) |
| 14 | +} |
| 15 | + |
| 16 | +/** |
| 17 | + * Plain mixin where the superclass must be Initable |
| 18 | + */ |
| 19 | +export const Serializable = <K extends Constructor<Initable> & Initable>( |
| 20 | +>Serializable : Symbol(Serializable, Decl(mixinIntersectionIsValidbaseType.ts, 9, 12)) |
| 21 | +>K : Symbol(K, Decl(mixinIntersectionIsValidbaseType.ts, 9, 29)) |
| 22 | +>Constructor : Symbol(Constructor, Decl(mixinIntersectionIsValidbaseType.ts, 0, 0)) |
| 23 | +>Initable : Symbol(Initable, Decl(mixinIntersectionIsValidbaseType.ts, 0, 79)) |
| 24 | +>Initable : Symbol(Initable, Decl(mixinIntersectionIsValidbaseType.ts, 0, 79)) |
| 25 | + |
| 26 | + SuperClass: K |
| 27 | +>SuperClass : Symbol(SuperClass, Decl(mixinIntersectionIsValidbaseType.ts, 9, 73)) |
| 28 | +>K : Symbol(K, Decl(mixinIntersectionIsValidbaseType.ts, 9, 29)) |
| 29 | + |
| 30 | +) => { |
| 31 | + const LocalMixin = (InnerSuperClass: K) => { |
| 32 | +>LocalMixin : Symbol(LocalMixin, Decl(mixinIntersectionIsValidbaseType.ts, 12, 9)) |
| 33 | +>InnerSuperClass : Symbol(InnerSuperClass, Decl(mixinIntersectionIsValidbaseType.ts, 12, 24)) |
| 34 | +>K : Symbol(K, Decl(mixinIntersectionIsValidbaseType.ts, 9, 29)) |
| 35 | + |
| 36 | + return class SerializableLocal extends InnerSuperClass { |
| 37 | +>SerializableLocal : Symbol(SerializableLocal, Decl(mixinIntersectionIsValidbaseType.ts, 13, 14)) |
| 38 | +>InnerSuperClass : Symbol(InnerSuperClass, Decl(mixinIntersectionIsValidbaseType.ts, 12, 24)) |
| 39 | + } |
| 40 | + }; |
| 41 | + let ResultClass = LocalMixin(SuperClass); |
| 42 | +>ResultClass : Symbol(ResultClass, Decl(mixinIntersectionIsValidbaseType.ts, 16, 7)) |
| 43 | +>LocalMixin : Symbol(LocalMixin, Decl(mixinIntersectionIsValidbaseType.ts, 12, 9)) |
| 44 | +>SuperClass : Symbol(SuperClass, Decl(mixinIntersectionIsValidbaseType.ts, 9, 73)) |
| 45 | + |
| 46 | + return ResultClass; |
| 47 | +>ResultClass : Symbol(ResultClass, Decl(mixinIntersectionIsValidbaseType.ts, 16, 7)) |
| 48 | + |
| 49 | +}; |
| 50 | + |
| 51 | +const AMixin = <K extends Constructor<Initable> & Initable>(SuperClass: K) => { |
| 52 | +>AMixin : Symbol(AMixin, Decl(mixinIntersectionIsValidbaseType.ts, 20, 5)) |
| 53 | +>K : Symbol(K, Decl(mixinIntersectionIsValidbaseType.ts, 20, 16)) |
| 54 | +>Constructor : Symbol(Constructor, Decl(mixinIntersectionIsValidbaseType.ts, 0, 0)) |
| 55 | +>Initable : Symbol(Initable, Decl(mixinIntersectionIsValidbaseType.ts, 0, 79)) |
| 56 | +>Initable : Symbol(Initable, Decl(mixinIntersectionIsValidbaseType.ts, 0, 79)) |
| 57 | +>SuperClass : Symbol(SuperClass, Decl(mixinIntersectionIsValidbaseType.ts, 20, 60)) |
| 58 | +>K : Symbol(K, Decl(mixinIntersectionIsValidbaseType.ts, 20, 16)) |
| 59 | + |
| 60 | + let SomeHowOkay = class A extends SuperClass { |
| 61 | +>SomeHowOkay : Symbol(SomeHowOkay, Decl(mixinIntersectionIsValidbaseType.ts, 21, 7)) |
| 62 | +>A : Symbol(A, Decl(mixinIntersectionIsValidbaseType.ts, 21, 21)) |
| 63 | +>SuperClass : Symbol(SuperClass, Decl(mixinIntersectionIsValidbaseType.ts, 20, 60)) |
| 64 | + |
| 65 | + }; |
| 66 | + |
| 67 | + let SomeHowNotOkay = class A extends Serializable(SuperClass) { |
| 68 | +>SomeHowNotOkay : Symbol(SomeHowNotOkay, Decl(mixinIntersectionIsValidbaseType.ts, 24, 7)) |
| 69 | +>A : Symbol(A, Decl(mixinIntersectionIsValidbaseType.ts, 24, 24)) |
| 70 | +>Serializable : Symbol(Serializable, Decl(mixinIntersectionIsValidbaseType.ts, 9, 12)) |
| 71 | +>SuperClass : Symbol(SuperClass, Decl(mixinIntersectionIsValidbaseType.ts, 20, 60)) |
| 72 | + |
| 73 | + }; |
| 74 | +}; |
0 commit comments