ts-essentials: Compile error in 9.1.0
Upgrading ts-essentials from 9.0.0 to 9.1.0 causes a compile error in my project (but not on any of my own sources):
➤ YN0000: executing [tsc]: tsc
../../.yarn/__virtual__/ts-essentials-virtual-35892e1d39/0/cache/ts-essentials-npm-9.1.0-2e85644a24-686f242bb1.zip/node_modules/ts-essentials/dist/types.d.ts:282:28 - error TS2344: Type 'Filter[K & keyof Filter]' does not satisfy the constraint 'DeepModify<
T[K]>'.
Type 'Filter[string] | Filter[number] | Filter[symbol]' is not assignable to type 'DeepModify<T[K]>'.
Type 'Filter[string]' is not assignable to type 'DeepModify<T[K]>'.
Type 'unknown' is not assignable to type 'DeepModify<T[K]>'.
Type 'unknown' is not assignable to type 'T[K] extends WeakMap<infer K, infer E> ? WeakMap<K, DeepModify<E>> : never'.
Type 'Filter[string]' is not assignable to type 'T[K] extends WeakMap<infer K, infer E> ? WeakMap<K, DeepModify<E>> : never'.
Type 'Filter[K & keyof Filter]' is not assignable to type 'T[K] extends WeakMap<infer K, infer E> ? WeakMap<K, DeepModify<E>> : never'.
Type 'Filter[string] | Filter[number] | Filter[symbol]' is not assignable to type 'T[K] extends WeakMap<infer K, infer E> ? WeakMap<K, DeepModify<E>> : never'.
Type 'Filter[string]' is not assignable to type 'T[K] extends WeakMap<infer K, infer E> ? WeakMap<K, DeepModify<E>> : never'.
Type 'unknown' is not assignable to type 'T[K] extends WeakMap<infer K, infer E> ? WeakMap<K, DeepModify<E>> : never'.
282 ? DeepOmit<T[K], Filter[K & keyof Filter]>
It’s a yarn 3.1.0 project (pnp enabled) with ts 4.5.4. My intellij doesn’t show any issue in this file. Not sure anything else could be relevant. Full source and build
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 18 (4 by maintainers)
Done ✅
Great, thanks for the fix
Thanks for the hard work 👍
I will check what was changed since
4.4.4– https://tsplay.dev/wj4E6m, but I don’t see the error thereWhat I found that
unknownis handled a bit differently and that can be an issueI will also probably fix it with
// @ts-ignorecomment as the behaviour between versions are differentHey @leaumar 👋
Thank you for the report!
I’m on it, I will check it in a moment