|
| 1 | +=== tests/cases/compiler/typeInferenceWithExcessPropertiesJsx.tsx === |
| 2 | +/// <reference path="react16.d.ts" /> |
| 3 | + |
| 4 | +import React = require('react'); |
| 5 | +>React : Symbol(React, Decl(typeInferenceWithExcessPropertiesJsx.tsx, 0, 0)) |
| 6 | + |
| 7 | +type TranslationEntry = { |
| 8 | +>TranslationEntry : Symbol(TranslationEntry, Decl(typeInferenceWithExcessPropertiesJsx.tsx, 2, 32)) |
| 9 | + |
| 10 | + args: [] | [unknown]; |
| 11 | +>args : Symbol(args, Decl(typeInferenceWithExcessPropertiesJsx.tsx, 4, 25)) |
| 12 | +} |
| 13 | +type Translations = { |
| 14 | +>Translations : Symbol(Translations, Decl(typeInferenceWithExcessPropertiesJsx.tsx, 6, 1)) |
| 15 | + |
| 16 | + a: { args: [string] }, |
| 17 | +>a : Symbol(a, Decl(typeInferenceWithExcessPropertiesJsx.tsx, 7, 21)) |
| 18 | +>args : Symbol(args, Decl(typeInferenceWithExcessPropertiesJsx.tsx, 8, 8)) |
| 19 | + |
| 20 | + b: { args: [] } |
| 21 | +>b : Symbol(b, Decl(typeInferenceWithExcessPropertiesJsx.tsx, 8, 26)) |
| 22 | +>args : Symbol(args, Decl(typeInferenceWithExcessPropertiesJsx.tsx, 9, 8)) |
| 23 | +} |
| 24 | +type TProps<Entry extends TranslationEntry> = { |
| 25 | +>TProps : Symbol(TProps, Decl(typeInferenceWithExcessPropertiesJsx.tsx, 10, 1)) |
| 26 | +>Entry : Symbol(Entry, Decl(typeInferenceWithExcessPropertiesJsx.tsx, 11, 12)) |
| 27 | +>TranslationEntry : Symbol(TranslationEntry, Decl(typeInferenceWithExcessPropertiesJsx.tsx, 2, 32)) |
| 28 | + |
| 29 | + getTranslationEntry: (allTranslations: Translations) => Entry, |
| 30 | +>getTranslationEntry : Symbol(getTranslationEntry, Decl(typeInferenceWithExcessPropertiesJsx.tsx, 11, 47)) |
| 31 | +>allTranslations : Symbol(allTranslations, Decl(typeInferenceWithExcessPropertiesJsx.tsx, 12, 26)) |
| 32 | +>Translations : Symbol(Translations, Decl(typeInferenceWithExcessPropertiesJsx.tsx, 6, 1)) |
| 33 | +>Entry : Symbol(Entry, Decl(typeInferenceWithExcessPropertiesJsx.tsx, 11, 12)) |
| 34 | + |
| 35 | +} & (Entry["args"] extends [unknown] ? { |
| 36 | +>Entry : Symbol(Entry, Decl(typeInferenceWithExcessPropertiesJsx.tsx, 11, 12)) |
| 37 | + |
| 38 | + args: Entry["args"][0] |
| 39 | +>args : Symbol(args, Decl(typeInferenceWithExcessPropertiesJsx.tsx, 13, 40)) |
| 40 | +>Entry : Symbol(Entry, Decl(typeInferenceWithExcessPropertiesJsx.tsx, 11, 12)) |
| 41 | + |
| 42 | +} : {}); |
| 43 | + |
| 44 | +declare function T<Entry extends TranslationEntry>( |
| 45 | +>T : Symbol(T, Decl(typeInferenceWithExcessPropertiesJsx.tsx, 15, 8)) |
| 46 | +>Entry : Symbol(Entry, Decl(typeInferenceWithExcessPropertiesJsx.tsx, 17, 19)) |
| 47 | +>TranslationEntry : Symbol(TranslationEntry, Decl(typeInferenceWithExcessPropertiesJsx.tsx, 2, 32)) |
| 48 | + |
| 49 | + props: TProps<Entry> |
| 50 | +>props : Symbol(props, Decl(typeInferenceWithExcessPropertiesJsx.tsx, 17, 51)) |
| 51 | +>TProps : Symbol(TProps, Decl(typeInferenceWithExcessPropertiesJsx.tsx, 10, 1)) |
| 52 | +>Entry : Symbol(Entry, Decl(typeInferenceWithExcessPropertiesJsx.tsx, 17, 19)) |
| 53 | + |
| 54 | +): JSX.Element; |
| 55 | +>JSX : Symbol(JSX, Decl(react16.d.ts, 2493, 12)) |
| 56 | +>Element : Symbol(JSX.Element, Decl(react16.d.ts, 2494, 23)) |
| 57 | + |
| 58 | +<T getTranslationEntry={(allTranslations) => allTranslations.a} args="a" /> |
| 59 | +>T : Symbol(T, Decl(typeInferenceWithExcessPropertiesJsx.tsx, 15, 8)) |
| 60 | +>getTranslationEntry : Symbol(getTranslationEntry, Decl(typeInferenceWithExcessPropertiesJsx.tsx, 21, 2)) |
| 61 | +>allTranslations : Symbol(allTranslations, Decl(typeInferenceWithExcessPropertiesJsx.tsx, 21, 25)) |
| 62 | +>allTranslations.a : Symbol(a, Decl(typeInferenceWithExcessPropertiesJsx.tsx, 7, 21)) |
| 63 | +>allTranslations : Symbol(allTranslations, Decl(typeInferenceWithExcessPropertiesJsx.tsx, 21, 25)) |
| 64 | +>a : Symbol(a, Decl(typeInferenceWithExcessPropertiesJsx.tsx, 7, 21)) |
| 65 | +>args : Symbol(args, Decl(typeInferenceWithExcessPropertiesJsx.tsx, 21, 63)) |
| 66 | + |
0 commit comments