I have the following code:
const EOption = {
Some: 0,
None: 1
} as const;
interface Enum<T> {
variant: T[keyof T]
}
class Option<T> implements Enum<typeof EOption> {
variant = EOption.Some;
}
type ExtractEnumType<T> = T extends Enum<infer R> ? R : never;
type L = ExtractEnumType<Option<string>>
What I'm expecting is that L would be of type "typeof EOption" but it seems to be "never", How can I make it so that is the case?