|
| 1 | +=== tests/cases/compiler/reverseMappedTypeContextualTypeNotCircular.ts === |
| 2 | +type Selector<S, R> = (state: S) => R; |
| 3 | +>Selector : Symbol(Selector, Decl(reverseMappedTypeContextualTypeNotCircular.ts, 0, 0)) |
| 4 | +>S : Symbol(S, Decl(reverseMappedTypeContextualTypeNotCircular.ts, 0, 14)) |
| 5 | +>R : Symbol(R, Decl(reverseMappedTypeContextualTypeNotCircular.ts, 0, 16)) |
| 6 | +>state : Symbol(state, Decl(reverseMappedTypeContextualTypeNotCircular.ts, 0, 23)) |
| 7 | +>S : Symbol(S, Decl(reverseMappedTypeContextualTypeNotCircular.ts, 0, 14)) |
| 8 | +>R : Symbol(R, Decl(reverseMappedTypeContextualTypeNotCircular.ts, 0, 16)) |
| 9 | + |
| 10 | +declare function createStructuredSelector<S, T>( |
| 11 | +>createStructuredSelector : Symbol(createStructuredSelector, Decl(reverseMappedTypeContextualTypeNotCircular.ts, 0, 38)) |
| 12 | +>S : Symbol(S, Decl(reverseMappedTypeContextualTypeNotCircular.ts, 2, 42)) |
| 13 | +>T : Symbol(T, Decl(reverseMappedTypeContextualTypeNotCircular.ts, 2, 44)) |
| 14 | + |
| 15 | + selectors: {[K in keyof T]: Selector<S, T[K]>}, |
| 16 | +>selectors : Symbol(selectors, Decl(reverseMappedTypeContextualTypeNotCircular.ts, 2, 48)) |
| 17 | +>K : Symbol(K, Decl(reverseMappedTypeContextualTypeNotCircular.ts, 3, 15)) |
| 18 | +>T : Symbol(T, Decl(reverseMappedTypeContextualTypeNotCircular.ts, 2, 44)) |
| 19 | +>Selector : Symbol(Selector, Decl(reverseMappedTypeContextualTypeNotCircular.ts, 0, 0)) |
| 20 | +>S : Symbol(S, Decl(reverseMappedTypeContextualTypeNotCircular.ts, 2, 42)) |
| 21 | +>T : Symbol(T, Decl(reverseMappedTypeContextualTypeNotCircular.ts, 2, 44)) |
| 22 | +>K : Symbol(K, Decl(reverseMappedTypeContextualTypeNotCircular.ts, 3, 15)) |
| 23 | + |
| 24 | +): Selector<S, T>; |
| 25 | +>Selector : Symbol(Selector, Decl(reverseMappedTypeContextualTypeNotCircular.ts, 0, 0)) |
| 26 | +>S : Symbol(S, Decl(reverseMappedTypeContextualTypeNotCircular.ts, 2, 42)) |
| 27 | +>T : Symbol(T, Decl(reverseMappedTypeContextualTypeNotCircular.ts, 2, 44)) |
| 28 | + |
| 29 | +const editable = () => ({}); |
| 30 | +>editable : Symbol(editable, Decl(reverseMappedTypeContextualTypeNotCircular.ts, 6, 5)) |
| 31 | + |
| 32 | +const mapStateToProps = createStructuredSelector({ |
| 33 | +>mapStateToProps : Symbol(mapStateToProps, Decl(reverseMappedTypeContextualTypeNotCircular.ts, 8, 5)) |
| 34 | +>createStructuredSelector : Symbol(createStructuredSelector, Decl(reverseMappedTypeContextualTypeNotCircular.ts, 0, 38)) |
| 35 | + |
| 36 | + editable: (state: any, props: any) => editable(), // expect "Type '(state: any, props: any) => {}' is not assignable to type 'Selector<unknown, {}>'", _not_ a circularity error |
| 37 | +>editable : Symbol(editable, Decl(reverseMappedTypeContextualTypeNotCircular.ts, 8, 50)) |
| 38 | +>state : Symbol(state, Decl(reverseMappedTypeContextualTypeNotCircular.ts, 9, 13)) |
| 39 | +>props : Symbol(props, Decl(reverseMappedTypeContextualTypeNotCircular.ts, 9, 24)) |
| 40 | +>editable : Symbol(editable, Decl(reverseMappedTypeContextualTypeNotCircular.ts, 6, 5)) |
| 41 | + |
| 42 | +}); |
0 commit comments