bug: `Get<>` ==> `unknown`
Author: salisbury-espinosaCreated Aug 14, 2026Updated Aug 14, 2026
Labelsbug
Bug description
import type { Get, Paths } from 'type-fest';
type Test =
| {
mode: 'test1';
foo: {
bar: number;
};
}
| {
mode: 'test2';
foo: {
bar: boolean;
bar_only_in_test2: string;
};
};
type PathsType = Paths<Test, { leavesOnly: true }>;
const testPath = 'foo.bar_only_in_test2' as const satisfies PathsType;
//success cause Get<Test, 'foo.bar_only_in_test2'> ===> unknown
const test: Get<Test, 'foo.bar_only_in_test2'> = 123;
Repro
Source: sindresorhus/type-fest