1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
=== tests/cases/compiler/nonNullableWithNullableGenericIndexedAccessArg.ts ===
// repro from #50539
interface StateSchema {
states?: {
>states : { [key: string]: StateSchema; } | undefined
[key: string]: StateSchema;
>key : string
};
}
declare class StateNode<TStateSchema extends StateSchema> {
>StateNode : StateNode<TStateSchema>
schema: TStateSchema;
>schema : TStateSchema
}
type StateNodesConfig<TStateSchema extends StateSchema> = {
>StateNodesConfig : StateNodesConfig<TStateSchema>
[K in keyof TStateSchema["states"]]: StateNode<NonNullable<TStateSchema["states"]>[K]>;
};
// repro from #50539#issuecomment-1234067835
type Ordering<TOrderBy extends string> = {
>Ordering : Ordering<TOrderBy>
orderBy: TOrderBy
>orderBy : TOrderBy
}
type Query<TOrderBy extends string> = {
>Query : Query<TOrderBy>
order?: Ordering<TOrderBy>
>order : Ordering<TOrderBy> | undefined
}
type QueryHandler<
>QueryHandler : QueryHandler<TQuery, TOrderBy>
TQuery extends Query<TOrderBy>,
TOrderBy extends string = NonNullable<TQuery["order"]>["orderBy"]
> = {}
|