Skip to content

Commit

Permalink
added a comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Harris-Miller committed Jun 29, 2023
1 parent 0f65159 commit 5a099d1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions types/concat.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ export function concat<T2>(__: Placeholder, list2: readonly T2[]): <T1>(list1: (
// concat(string, string)
export function concat<S1 extends string, S2 extends string>(s1: S1, s2: S2): string extends (S1 | S2) ? string : `${S1}${S2}`;
// concat(list, list)
// if you don't do 2 types here the single T will collapse list1 and list2 when you have tuples of the same type, which is incorrect behavior
export function concat<T1, T2 extends T1>(list1: readonly T1[], list2: readonly T2[]): T1[];

0 comments on commit 5a099d1

Please sign in to comment.