WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Incorrect Type Inference with mergeDeepRight, mergeDeepLeft, mergeRight, mergeLeft when Merging T and Partial<T> #130

@o-svetlichnyi

Description

@o-svetlichnyi

Description:

After updating to the latest versions of ramda and @types/ramda, I encountered an issue with the type inference of the mergeDeepRight function in TypeScript. Specifically, when merging an object of type T with a Partial, the resulting type is not correctly inferred as T. Instead, properties are being inferred as unknown, leading to type errors.

This behavior did not occur in the previous versions ([email protected] and @types/[email protected]), where the types were correctly inferred, and the merge operation worked without any type assertions or errors.

Affected Versions:

    "@types/ramda": "^0.30.2",
    "ramda": "^0.30.1",
    "typescript": "^5.5.4"

Reproduction:
https://stackblitz.com/edit/vitejs-vite-xsspwg?file=index.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions