Skip to content

Commit dc490d4

Browse files
committed
test: add generic assignability case of SplitOnRestElement
1 parent 8bba628 commit dc490d4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test-d/split-on-rest-element.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {expectType} from 'tsd';
2-
import type {SplitOnRestElement} from '../index.d.ts';
2+
import type {SplitOnRestElement, UnknownArray} from '../index.d.ts';
33

44
// Fixed tuples (No rest element)
55
expectType<SplitOnRestElement<[]>>({} as [[], [], []]);
@@ -53,3 +53,7 @@ expectType<SplitOnRestElement<readonly [1, 2, 3]>>({} as readonly [[1, 2, 3], []
5353
// Edge: `never` / `any`
5454
expectType<SplitOnRestElement<any>>({} as any);
5555
expectType<SplitOnRestElement<never>>({} as never);
56+
57+
// Generic instantiations
58+
type Assignability<_T extends UnknownArray> = unknown;
59+
type TestAssignability<T extends UnknownArray> = Assignability<SplitOnRestElement<T>>;

0 commit comments

Comments
 (0)