fix: change unreachable branch to never in FlattenedMessages

The last branch of the conditional is unreachable since TMessages[TKey]
is constrained to string | AnyNestedMessages.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
This commit is contained in:
Fredrik Adelöw
2026-03-24 22:54:11 +01:00
parent ddc5247f67
commit 7a39b2c4ea
@@ -60,7 +60,7 @@ type FlattenedMessages<TMessages extends AnyNestedMessages> =
string}`]: TNested[TNestedKey];
}
: never
: { [_ in TKey]: TMessages[TKey] }, // Other primitive values are passed through with the same key,
: never, // Unreachable: TMessages[TKey] is always string or AnyNestedMessages
) => void;
// The `[keyof TMessages]` extracts the object values union from our flattened structure, still wrapped up in function parameters.
// The `extends (_: infer TIntersection) => void` flips the union to an intersection, at which point we have the correct type.