In the scenario where I define an interface with a generic like this:
interface I1<S> {
a: string;
b: genericType<S>
}
When attempting to access the type of property a
using I1['a']
, TypeScript raises the following error:
TS2314: Generic type 'I1<S>' requires 1 type argument(s).
Is it not correct since the extracted property type is not actually dependent on <S>
? Perhaps there is a misunderstanding in my understanding of how TypeScript functions or this should indeed be acceptable.