Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional tags are lost after merge #601

Closed
asins opened this issue Apr 24, 2023 · 0 comments · Fixed by #787
Closed

Optional tags are lost after merge #601

asins opened this issue Apr 24, 2023 · 0 comments · Fixed by #787

Comments

@asins
Copy link

asins commented Apr 24, 2023

interface A {
  t1?: number;
  t2?: number;
  t3?: number;
  t4?: number;
}

type B = Pick<A, 't2' | 't4'> & {
  hostList: string[];
};

When the Merge method is executed

type MergeB = Merge<Pick<A, 't2' | 't4'>, {
  hostList: string[];
}>;

the desired result is:

type MergeB = {
    t2?: number;
    t4?: number;
    hostList: IRegionPoint[];
}

The actual result is:

type MergeB = {
    t2?: number;
    t4?: number;
    hostList?: IRegionPoint[];  // <--- Not what I expected
}

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • The funding will be given to active contributors.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant