$ npm run build
> ditest@0.0.1 build /home/vagrant/workspace/proto/typescript/ditest
> tsc -p tsconfig.json
index.ts:29:3 - error TS2322: Type 'Hoge | Foo' is not assignable to type 'Deps[K]'.
Type 'Hoge' is not assignable to type 'Deps[K]'.
Type 'Hoge' is not assignable to type 'Foo & Hoge'.
Property 'fooProp' is missing in type 'Hoge' but required in type 'Foo'.
29 return deps[cls]();
~~~~~~~~~~~~~~~~~~~
index.ts:6:15
6 constructor(protected readonly fooProp: number) {}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'fooProp' is declared here.
Found 1 error.
🤔