|
| 1 | +=== tests/cases/compiler/multipleInferenceContexts.ts === |
| 2 | +type ConstructorOptions<Data> = |
| 3 | +>ConstructorOptions : Symbol(ConstructorOptions, Decl(multipleInferenceContexts.ts, 0, 0)) |
| 4 | +>Data : Symbol(Data, Decl(multipleInferenceContexts.ts, 0, 24)) |
| 5 | + |
| 6 | + & ComponentOptionsProperties<Data> |
| 7 | +>ComponentOptionsProperties : Symbol(ComponentOptionsProperties, Decl(multipleInferenceContexts.ts, 2, 31)) |
| 8 | +>Data : Symbol(Data, Decl(multipleInferenceContexts.ts, 0, 24)) |
| 9 | + |
| 10 | + & ThisType<Instance<Data>>; |
| 11 | +>ThisType : Symbol(ThisType, Decl(lib.es5.d.ts, --, --)) |
| 12 | +>Instance : Symbol(Instance, Decl(multipleInferenceContexts.ts, 7, 1)) |
| 13 | +>Data : Symbol(Data, Decl(multipleInferenceContexts.ts, 0, 24)) |
| 14 | + |
| 15 | +interface ComponentOptionsProperties<Data> { |
| 16 | +>ComponentOptionsProperties : Symbol(ComponentOptionsProperties, Decl(multipleInferenceContexts.ts, 2, 31)) |
| 17 | +>Data : Symbol(Data, Decl(multipleInferenceContexts.ts, 4, 37)) |
| 18 | + |
| 19 | + data: Data; |
| 20 | +>data : Symbol(ComponentOptionsProperties.data, Decl(multipleInferenceContexts.ts, 4, 44)) |
| 21 | +>Data : Symbol(Data, Decl(multipleInferenceContexts.ts, 4, 37)) |
| 22 | + |
| 23 | + render(): unknown; |
| 24 | +>render : Symbol(ComponentOptionsProperties.render, Decl(multipleInferenceContexts.ts, 5, 15)) |
| 25 | +} |
| 26 | + |
| 27 | +interface Instance<Data> { |
| 28 | +>Instance : Symbol(Instance, Decl(multipleInferenceContexts.ts, 7, 1)) |
| 29 | +>Data : Symbol(Data, Decl(multipleInferenceContexts.ts, 9, 19)) |
| 30 | + |
| 31 | + get<K extends keyof Data>(name: K): unknown; |
| 32 | +>get : Symbol(Instance.get, Decl(multipleInferenceContexts.ts, 9, 26)) |
| 33 | +>K : Symbol(K, Decl(multipleInferenceContexts.ts, 10, 8)) |
| 34 | +>Data : Symbol(Data, Decl(multipleInferenceContexts.ts, 9, 19)) |
| 35 | +>name : Symbol(name, Decl(multipleInferenceContexts.ts, 10, 30)) |
| 36 | +>K : Symbol(K, Decl(multipleInferenceContexts.ts, 10, 8)) |
| 37 | +} |
| 38 | + |
| 39 | +declare var Moon: { |
| 40 | +>Moon : Symbol(Moon, Decl(multipleInferenceContexts.ts, 13, 11)) |
| 41 | + |
| 42 | + <Data>(options?: ConstructorOptions<Data>): Instance<Data>; |
| 43 | +>Data : Symbol(Data, Decl(multipleInferenceContexts.ts, 14, 5)) |
| 44 | +>options : Symbol(options, Decl(multipleInferenceContexts.ts, 14, 11)) |
| 45 | +>ConstructorOptions : Symbol(ConstructorOptions, Decl(multipleInferenceContexts.ts, 0, 0)) |
| 46 | +>Data : Symbol(Data, Decl(multipleInferenceContexts.ts, 14, 5)) |
| 47 | +>Instance : Symbol(Instance, Decl(multipleInferenceContexts.ts, 7, 1)) |
| 48 | +>Data : Symbol(Data, Decl(multipleInferenceContexts.ts, 14, 5)) |
| 49 | + |
| 50 | +}; |
| 51 | + |
| 52 | +const r2 = Moon({ |
| 53 | +>r2 : Symbol(r2, Decl(multipleInferenceContexts.ts, 17, 5)) |
| 54 | +>Moon : Symbol(Moon, Decl(multipleInferenceContexts.ts, 13, 11)) |
| 55 | + |
| 56 | + data: { msg: "" }, |
| 57 | +>data : Symbol(data, Decl(multipleInferenceContexts.ts, 17, 17)) |
| 58 | +>msg : Symbol(msg, Decl(multipleInferenceContexts.ts, 18, 11)) |
| 59 | + |
| 60 | + render() { |
| 61 | +>render : Symbol(render, Decl(multipleInferenceContexts.ts, 18, 22)) |
| 62 | + |
| 63 | + const h = (x: unknown) => x; |
| 64 | +>h : Symbol(h, Decl(multipleInferenceContexts.ts, 20, 13)) |
| 65 | +>x : Symbol(x, Decl(multipleInferenceContexts.ts, 20, 19)) |
| 66 | +>x : Symbol(x, Decl(multipleInferenceContexts.ts, 20, 19)) |
| 67 | + |
| 68 | + return h(this.get("msg")); |
| 69 | +>h : Symbol(h, Decl(multipleInferenceContexts.ts, 20, 13)) |
| 70 | +>this.get : Symbol(Instance.get, Decl(multipleInferenceContexts.ts, 9, 26)) |
| 71 | +>this : Symbol(Instance, Decl(multipleInferenceContexts.ts, 7, 1)) |
| 72 | +>get : Symbol(Instance.get, Decl(multipleInferenceContexts.ts, 9, 26)) |
| 73 | + |
| 74 | + }, |
| 75 | +}); |
| 76 | + |
0 commit comments