|
| 1 | +=== tests/cases/compiler/contextualTypingReturnStatementWithReturnTypeAnnotation.ts === |
| 2 | +type PropOfRaw<T> = readonly T[] | "not-array" | "no-prop"; |
| 3 | +>PropOfRaw : Symbol(PropOfRaw, Decl(contextualTypingReturnStatementWithReturnTypeAnnotation.ts, 0, 0)) |
| 4 | +>T : Symbol(T, Decl(contextualTypingReturnStatementWithReturnTypeAnnotation.ts, 0, 15)) |
| 5 | +>T : Symbol(T, Decl(contextualTypingReturnStatementWithReturnTypeAnnotation.ts, 0, 15)) |
| 6 | + |
| 7 | +declare function isString(text: unknown): text is string; |
| 8 | +>isString : Symbol(isString, Decl(contextualTypingReturnStatementWithReturnTypeAnnotation.ts, 0, 59)) |
| 9 | +>text : Symbol(text, Decl(contextualTypingReturnStatementWithReturnTypeAnnotation.ts, 2, 26)) |
| 10 | +>text : Symbol(text, Decl(contextualTypingReturnStatementWithReturnTypeAnnotation.ts, 2, 26)) |
| 11 | + |
| 12 | +declare function getPropFromRaw<T>( |
| 13 | +>getPropFromRaw : Symbol(getPropFromRaw, Decl(contextualTypingReturnStatementWithReturnTypeAnnotation.ts, 2, 57)) |
| 14 | +>T : Symbol(T, Decl(contextualTypingReturnStatementWithReturnTypeAnnotation.ts, 4, 32)) |
| 15 | + |
| 16 | + prop: "files" | "include" | "exclude" | "references", |
| 17 | +>prop : Symbol(prop, Decl(contextualTypingReturnStatementWithReturnTypeAnnotation.ts, 4, 35)) |
| 18 | + |
| 19 | + validateElement: (value: unknown) => boolean, |
| 20 | +>validateElement : Symbol(validateElement, Decl(contextualTypingReturnStatementWithReturnTypeAnnotation.ts, 5, 55)) |
| 21 | +>value : Symbol(value, Decl(contextualTypingReturnStatementWithReturnTypeAnnotation.ts, 6, 20)) |
| 22 | + |
| 23 | + elementTypeName: string |
| 24 | +>elementTypeName : Symbol(elementTypeName, Decl(contextualTypingReturnStatementWithReturnTypeAnnotation.ts, 6, 47)) |
| 25 | + |
| 26 | +): PropOfRaw<T>; |
| 27 | +>PropOfRaw : Symbol(PropOfRaw, Decl(contextualTypingReturnStatementWithReturnTypeAnnotation.ts, 0, 0)) |
| 28 | +>T : Symbol(T, Decl(contextualTypingReturnStatementWithReturnTypeAnnotation.ts, 4, 32)) |
| 29 | + |
| 30 | +function getSpecsFromRaw( |
| 31 | +>getSpecsFromRaw : Symbol(getSpecsFromRaw, Decl(contextualTypingReturnStatementWithReturnTypeAnnotation.ts, 8, 16)) |
| 32 | + |
| 33 | + prop: "files" | "include" | "exclude" |
| 34 | +>prop : Symbol(prop, Decl(contextualTypingReturnStatementWithReturnTypeAnnotation.ts, 10, 25)) |
| 35 | + |
| 36 | +): PropOfRaw<string> { |
| 37 | +>PropOfRaw : Symbol(PropOfRaw, Decl(contextualTypingReturnStatementWithReturnTypeAnnotation.ts, 0, 0)) |
| 38 | + |
| 39 | + return getPropFromRaw(prop, isString, "string"); |
| 40 | +>getPropFromRaw : Symbol(getPropFromRaw, Decl(contextualTypingReturnStatementWithReturnTypeAnnotation.ts, 2, 57)) |
| 41 | +>prop : Symbol(prop, Decl(contextualTypingReturnStatementWithReturnTypeAnnotation.ts, 10, 25)) |
| 42 | +>isString : Symbol(isString, Decl(contextualTypingReturnStatementWithReturnTypeAnnotation.ts, 0, 59)) |
| 43 | +} |
| 44 | + |
0 commit comments