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

Fix #695 - support recursive intersection type #699

Merged
merged 2 commits into from
Jun 30, 2023
Merged

Fix #695 - support recursive intersection type #699

merged 2 commits into from
Jun 30, 2023

Conversation

samchon
Copy link
Owner

@samchon samchon commented Jun 30, 2023

typia could not validate recursive intersection type like below.

Of course, below type is an extremely crazy case, but as goal of typia is to supporting every TypeScript types, I've fixed it.

export type ISetupConfig =
  | ({
      type: 'Main';
    } & ISetupConfigMain)
  | ({
      type: 'Before';
    } & ISetupConfigBefore)
  | ({
      type: 'After';
    } & ISetupConfigAfter);

export type ISetupConfigMain = {
  content: ISetupConfig;
};

export type ISetupConfigBefore = {
  content: ISetupConfig;
};

export type ISetupConfigAfter = {
  content: ISetupConfig;
};

`typia` could not validate recursive intersection type like below. Of course, below type is an extremely crazy case, but as goal of `typia` is to supporting every TypeScript types, I've fixed it.

```typescript
export type ISetupConfig =
  | ({
      type: 'Main';
    } & ISetupConfigMain)
  | ({
      type: 'Before';
    } & ISetupConfigBefore)
  | ({
      type: 'After';
    } & ISetupConfigAfter);

export type ISetupConfigMain = {
  content: ISetupConfig;
};

export type ISetupConfigBefore = {
  content: ISetupConfig;
};

export type ISetupConfigAfter = {
  content: ISetupConfig;
};
```
@samchon samchon added bug Something isn't working enhancement New feature or request labels Jun 30, 2023
@samchon samchon self-assigned this Jun 30, 2023
Copy link
Owner Author

@samchon samchon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, no problem.

@samchon samchon merged commit 7da49f0 into master Jun 30, 2023
@samchon samchon deleted the issues/695 branch June 30, 2023 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant