mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
TS: Avoid infinite recursion in stringifyType
This commit is contained in:
@@ -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>>> |
|
||||
@@ -0,0 +1,4 @@
|
||||
import javascript
|
||||
|
||||
from TypeAliasDeclaration decl
|
||||
select decl, decl.getDefinition().getType()
|
||||
@@ -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>>>;
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
Reference in New Issue
Block a user