Merge pull request #1522 from asger-semmle/ts-stringify-recursive-type-alias

Approved by xiemaisi
This commit is contained in:
semmle-qlci
2019-07-03 08:25:50 +01:00
committed by GitHub
9 changed files with 29 additions and 6 deletions

View File

@@ -1 +1 @@
| unique symbol | esmodule | externalSymbol |
| typeof externalSymbol | esmodule | externalSymbol |

View File

@@ -0,0 +1,2 @@
| test.ts:3:1:7:6 | type Di ... \\n T; | Disjunction<T> |
| test.ts:9:8:9:65 | type Tr ... n<T>>>; | Disjunction<Disjunction<Disjunction<T>>> |

View File

@@ -0,0 +1,4 @@
import javascript
from TypeAliasDeclaration decl
select decl, decl.getDefinition().getType()

View File

@@ -0,0 +1,9 @@
import { ArrayBox, Box } from 'somewhere';
type Disjunction<T> =
T extends ArrayBox<infer U1> ? U1[] :
T extends Box<infer U2> ? U2 :
T extends ({[P in keyof T]: T[P]} & {p: any}) ? {[P in Exclude<keyof T, 'p'>]: Disjunction<T[P]>} :
T;
export type Triple<T> = Disjunction<Disjunction<Disjunction<T>>>;

View File

@@ -69,7 +69,7 @@
| tst.ts:28:22:28:25 | null | null |
| tst.ts:29:5:29:13 | neverType | () => never |
| tst.ts:30:5:30:14 | symbolType | symbol |
| tst.ts:31:7:31:22 | uniqueSymbolType | unique symbol |
| tst.ts:31:7:31:22 | uniqueSymbolType | typeof uniqueSymbolType |
| tst.ts:31:41:31:44 | null | null |
| tst.ts:32:5:32:14 | objectType | object |
| tst.ts:33:5:33:16 | intersection | string & { x: string; } |

View File

@@ -40,7 +40,7 @@
| tst.ts:29:16:29:26 | () => never | () => never |
| tst.ts:29:22:29:26 | never | never |
| tst.ts:30:17:30:22 | symbol | symbol |
| tst.ts:31:25:31:37 | unique symbol | unique symbol |
| tst.ts:31:25:31:37 | unique symbol | typeof uniqueSymbolType |
| tst.ts:32:17:32:22 | object | object |
| tst.ts:33:19:33:24 | string | string |
| tst.ts:33:19:33:38 | string & {x: string} | string & { x: string; } |