-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
Description
Flow version: v0.273.1
Expected behavior
type GetFirst = ['a', 'b', 'c'] extends [infer First, ...infer Rest]
? First
: empty;
declare var f: GetFirst;
// this should work
f as 'a';Actual behavior
Cannot cast
fto string literalabecause mixed [1] is incompatible with string literala[2]. [incompatible-cast]
Strangely, First is inferred fine when only using [infer First, ...], or [...infer Rest] + Rest[0]; see the three examples in the Try-Flow.