|
| 1 | +=== tests/cases/compiler/higherKindedTypesLift3.ts === |
| 2 | +interface StaticFunctor<CS<_TS>> { |
| 3 | +>StaticFunctor : Symbol(StaticFunctor, Decl(higherKindedTypesLift3.ts, 0, 0)) |
| 4 | +>CS : Symbol(CS, Decl(higherKindedTypesLift3.ts, 0, 24)) |
| 5 | +>_TS : Symbol(_TS, Decl(higherKindedTypesLift3.ts, 0, 27)) |
| 6 | + |
| 7 | + <AS, BS>(csas: CS<AS>, fmapstatic: (a: AS) => BS): CS<BS>; |
| 8 | +>AS : Symbol(AS, Decl(higherKindedTypesLift3.ts, 1, 5)) |
| 9 | +>BS : Symbol(BS, Decl(higherKindedTypesLift3.ts, 1, 8)) |
| 10 | +>csas : Symbol(csas, Decl(higherKindedTypesLift3.ts, 1, 13)) |
| 11 | +>CS : Symbol(CS, Decl(higherKindedTypesLift3.ts, 0, 24)) |
| 12 | +>AS : Symbol(AS, Decl(higherKindedTypesLift3.ts, 1, 5)) |
| 13 | +>fmapstatic : Symbol(fmapstatic, Decl(higherKindedTypesLift3.ts, 1, 26)) |
| 14 | +>a : Symbol(a, Decl(higherKindedTypesLift3.ts, 1, 40)) |
| 15 | +>AS : Symbol(AS, Decl(higherKindedTypesLift3.ts, 1, 5)) |
| 16 | +>BS : Symbol(BS, Decl(higherKindedTypesLift3.ts, 1, 8)) |
| 17 | +>CS : Symbol(CS, Decl(higherKindedTypesLift3.ts, 0, 24)) |
| 18 | +>BS : Symbol(BS, Decl(higherKindedTypesLift3.ts, 1, 8)) |
| 19 | +} |
| 20 | + |
| 21 | + |
| 22 | +interface LiftedResult<LC<_LT>> { |
| 23 | +>LiftedResult : Symbol(LiftedResult, Decl(higherKindedTypesLift3.ts, 2, 1)) |
| 24 | +>LC : Symbol(LC, Decl(higherKindedTypesLift3.ts, 5, 23)) |
| 25 | +>_LT : Symbol(_LT, Decl(higherKindedTypesLift3.ts, 5, 26)) |
| 26 | + |
| 27 | + <LA, LB>(lmap: (a: LA) => LB): (a: LC<LA>) => LC<LB>; |
| 28 | +>LA : Symbol(LA, Decl(higherKindedTypesLift3.ts, 6, 5)) |
| 29 | +>LB : Symbol(LB, Decl(higherKindedTypesLift3.ts, 6, 8)) |
| 30 | +>lmap : Symbol(lmap, Decl(higherKindedTypesLift3.ts, 6, 13)) |
| 31 | +>a : Symbol(a, Decl(higherKindedTypesLift3.ts, 6, 20)) |
| 32 | +>LA : Symbol(LA, Decl(higherKindedTypesLift3.ts, 6, 5)) |
| 33 | +>LB : Symbol(LB, Decl(higherKindedTypesLift3.ts, 6, 8)) |
| 34 | +>a : Symbol(a, Decl(higherKindedTypesLift3.ts, 6, 36)) |
| 35 | +>LC : Symbol(LC, Decl(higherKindedTypesLift3.ts, 5, 23)) |
| 36 | +>LA : Symbol(LA, Decl(higherKindedTypesLift3.ts, 6, 5)) |
| 37 | +>LC : Symbol(LC, Decl(higherKindedTypesLift3.ts, 5, 23)) |
| 38 | +>LB : Symbol(LB, Decl(higherKindedTypesLift3.ts, 6, 8)) |
| 39 | +} |
| 40 | + |
| 41 | +declare function lift<C<_T>>(fToLift: StaticFunctor<C>): LiftedResult<C> |
| 42 | +>lift : Symbol(lift, Decl(higherKindedTypesLift3.ts, 7, 1)) |
| 43 | +>C : Symbol(C, Decl(higherKindedTypesLift3.ts, 9, 22)) |
| 44 | +>_T : Symbol(_T, Decl(higherKindedTypesLift3.ts, 9, 24)) |
| 45 | +>fToLift : Symbol(fToLift, Decl(higherKindedTypesLift3.ts, 9, 29)) |
| 46 | +>StaticFunctor : Symbol(StaticFunctor, Decl(higherKindedTypesLift3.ts, 0, 0)) |
| 47 | +>C : Symbol(C, Decl(higherKindedTypesLift3.ts, 9, 22)) |
| 48 | +>LiftedResult : Symbol(LiftedResult, Decl(higherKindedTypesLift3.ts, 2, 1)) |
| 49 | +>C : Symbol(C, Decl(higherKindedTypesLift3.ts, 9, 22)) |
| 50 | + |
| 51 | + |
| 52 | +declare const myArrayFunctor: StaticFunctor<Array> |
| 53 | +>myArrayFunctor : Symbol(myArrayFunctor, Decl(higherKindedTypesLift3.ts, 12, 13)) |
| 54 | +>StaticFunctor : Symbol(StaticFunctor, Decl(higherKindedTypesLift3.ts, 0, 0)) |
| 55 | +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) |
| 56 | + |
| 57 | +const liftedArray = lift(myArrayFunctor); |
| 58 | +>liftedArray : Symbol(liftedArray, Decl(higherKindedTypesLift3.ts, 14, 5)) |
| 59 | +>lift : Symbol(lift, Decl(higherKindedTypesLift3.ts, 7, 1)) |
| 60 | +>myArrayFunctor : Symbol(myArrayFunctor, Decl(higherKindedTypesLift3.ts, 12, 13)) |
| 61 | + |
| 62 | +declare function stringLength(strarg: string): number |
| 63 | +>stringLength : Symbol(stringLength, Decl(higherKindedTypesLift3.ts, 14, 41)) |
| 64 | +>strarg : Symbol(strarg, Decl(higherKindedTypesLift3.ts, 16, 30)) |
| 65 | + |
| 66 | +const liftedStringLength = liftedArray(stringLength); |
| 67 | +>liftedStringLength : Symbol(liftedStringLength, Decl(higherKindedTypesLift3.ts, 18, 5)) |
| 68 | +>liftedArray : Symbol(liftedArray, Decl(higherKindedTypesLift3.ts, 14, 5)) |
| 69 | +>stringLength : Symbol(stringLength, Decl(higherKindedTypesLift3.ts, 14, 41)) |
| 70 | + |
| 71 | +declare const arrayOfStrings: Array<string>; |
| 72 | +>arrayOfStrings : Symbol(arrayOfStrings, Decl(higherKindedTypesLift3.ts, 20, 13)) |
| 73 | +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) |
| 74 | + |
| 75 | +const result = liftedStringLength(arrayOfStrings); |
| 76 | +>result : Symbol(result, Decl(higherKindedTypesLift3.ts, 22, 5)) |
| 77 | +>liftedStringLength : Symbol(liftedStringLength, Decl(higherKindedTypesLift3.ts, 18, 5)) |
| 78 | +>arrayOfStrings : Symbol(arrayOfStrings, Decl(higherKindedTypesLift3.ts, 20, 13)) |
| 79 | + |
| 80 | +const expectedType: Array<number> = result; |
| 81 | +>expectedType : Symbol(expectedType, Decl(higherKindedTypesLift3.ts, 23, 5)) |
| 82 | +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) |
| 83 | +>result : Symbol(result, Decl(higherKindedTypesLift3.ts, 22, 5)) |
| 84 | + |
| 85 | +const expectError = liftedStringLength(result) |
| 86 | +>expectError : Symbol(expectError, Decl(higherKindedTypesLift3.ts, 25, 5)) |
| 87 | +>liftedStringLength : Symbol(liftedStringLength, Decl(higherKindedTypesLift3.ts, 18, 5)) |
| 88 | +>result : Symbol(result, Decl(higherKindedTypesLift3.ts, 22, 5)) |
| 89 | + |
| 90 | + |
0 commit comments