samchon/typia

failed to generate with intersection type

Opened this issue · 0 comments

Bug Report

Note that, the bug you're reporting may have registered in the issues by another user. Even the bug you're reporting may have been fixed in the @next version. In such reasons, I recommend you to check the old issues and reproduct your code with the @next version before publishing the bug reporting issue.

`npm install --save-dev typia@next`

When the same error occurs even in the @next version, then please fill the below template:

📝 Summary

Write a short summary of the bug in here.

  • Typia Version: 6.9

maybe duplication of #911?

> pnpm typia generate --input src/templates --output src/generated
- JsonObject[key]: string & __type & __type.o1
  - nonsensible intersection

- JsonObject[key]: string & Array<JsonValue>
  - nonsensible intersection

- JsonObject[key]: string & ReadonlyArray<JsonValue>
  - nonsensible intersection

- JsonObject[key]: number & __type & __type.o1
  - nonsensible intersection

- JsonObject[key]: number & Array<JsonValue>
  - nonsensible intersection

- JsonObject[key]: number & ReadonlyArray<JsonValue>
  - nonsensible intersection

- JsonObject[key]: false & __type & __type.o1
  - nonsensible intersection

- JsonObject[key]: false & Array<JsonValue>
  - nonsensible intersection

- JsonObject[key]: false & ReadonlyArray<JsonValue>
  - nonsensible intersection

- JsonObject[key]: true & __type & __type.o1
  - nonsensible intersection

- JsonObject[key]: true & Array<JsonValue>
  - nonsensible intersection

- JsonObject[key]: true & ReadonlyArray<JsonValue>
  - nonsensible intersection

- JsonObject[key]: __type & __type.o1 & string
  - nonsensible intersection

- JsonObject[key]: __type & __type.o1 & number
  - nonsensible intersection

- JsonObject[key]: __type & __type.o1 & false
  - nonsensible intersection

- JsonObject[key]: __type & __type.o1 & true
  - nonsensible intersection

- { [x: string]: JsonValue; } & { [x: string]: JsonValue | undefined; }[key]: string & __type & __type.o1
  - nonsensible intersection

- { [x: string]: JsonValue; } & { [x: string]: JsonValue | undefined; }[key]: string & Array<JsonValue>
  - nonsensible intersection

- { [x: string]: JsonValue; } & { [x: string]: JsonValue | undefined; }[key]: string & ReadonlyArray<JsonValue>
  - nonsensible intersection

- { [x: string]: JsonValue; } & { [x: string]: JsonValue | undefined; }[key]: number & __type & __type.o1
  - nonsensible intersection

- { [x: string]: JsonValue; } & { [x: string]: JsonValue | undefined; }[key]: number & Array<JsonValue>
  - nonsensible intersection

- { [x: string]: JsonValue; } & { [x: string]: JsonValue | undefined; }[key]: number & ReadonlyArray<JsonValue>
  - nonsensible intersection

- { [x: string]: JsonValue; } & { [x: string]: JsonValue | undefined; }[key]: false & __type & __type.o1
  - nonsensible intersection

- { [x: string]: JsonValue; } & { [x: string]: JsonValue | undefined; }[key]: false & Array<JsonValue>
  - nonsensible intersection

- { [x: string]: JsonValue; } & { [x: string]: JsonValue | undefined; }[key]: false & ReadonlyArray<JsonValue>
  - nonsensible intersection

- { [x: string]: JsonValue; } & { [x: string]: JsonValue | undefined; }[key]: true & __type & __type.o1
  - nonsensible intersection

- { [x: string]: JsonValue; } & { [x: string]: JsonValue | undefined; }[key]: true & Array<JsonValue>
  - nonsensible intersection

- { [x: string]: JsonValue; } & { [x: string]: JsonValue | undefined; }[key]: true & ReadonlyArray<JsonValue>
  - nonsensible intersection

- { [x: string]: JsonValue; } & { [x: string]: JsonValue | undefined; }[key]: __type & __type.o1 & string
  - nonsensible intersection

- { [x: string]: JsonValue; } & { [x: string]: JsonValue | undefined; }[key]: __type & __type.o1 & number
  - nonsensible intersection

- { [x: string]: JsonValue; } & { [x: string]: JsonValue | undefined; }[key]: __type & __type.o1 & false
  - nonsensible intersection

- { [x: string]: JsonValue; } & { [x: string]: JsonValue | undefined; }[key]: __type & __type.o1 & true
  - nonsensible intersection

- { [x: string]: JsonValue; } & { [x: string]: JsonValue | undefined; }[key]: __type & __type.o1 & Array<JsonValue>
  - nonsensible intersection

- { [x: string]: JsonValue; } & { [x: string]: JsonValue | undefined; }[key]: __type & __type.o1 & ReadonlyArray<JsonValue>
  - nonsensible intersection

- { [x: string]: JsonValue; } & { [x: string]: JsonValue | undefined; }[key]: Array<JsonValue> & string
  - nonsensible intersection

- { [x: string]: JsonValue; } & { [x: string]: JsonValue | undefined; }[key]: Array<JsonValue> & number
  - nonsensible intersection

- { [x: string]: JsonValue; } & { [x: string]: JsonValue | undefined; }[key]: Array<JsonValue> & false
  - nonsensible intersection

- { [x: string]: JsonValue; } & { [x: string]: JsonValue | undefined; }[key]: Array<JsonValue> & true
  - nonsensible intersection

- { [x: string]: JsonValue; } & { [x: string]: JsonValue | undefined; }[key]: Array<JsonValue> & __type & __type.o1
  - nonsensible intersection

- { [x: string]: JsonValue; } & { [x: string]: JsonValue | undefined; }[key]: Array<JsonValue> & ReadonlyArray<JsonValue>
  - nonsensible intersection

- { [x: string]: JsonValue; } & { [x: string]: JsonValue | undefined; }[key]: ReadonlyArray<JsonValue> & string
  - nonsensible intersection

- { [x: string]: JsonValue; } & { [x: string]: JsonValue | undefined; }[key]: ReadonlyArray<JsonValue> & number
  - nonsensible intersection

- { [x: string]: JsonValue; } & { [x: string]: JsonValue | undefined; }[key]: ReadonlyArray<JsonValue> & false
  - nonsensible intersection

- { [x: string]: JsonValue; } & { [x: string]: JsonValue | undefined; }[key]: ReadonlyArray<JsonValue> & true
  - nonsensible intersection

- { [x: string]: JsonValue; } & { [x: string]: JsonValue | undefined; }[key]: ReadonlyArray<JsonValue> & __type & __type.o1
  - nonsensible intersection

- { [x: string]: JsonValue; } & { [x: string]: JsonValue | undefined; }[key]: ReadonlyArray<JsonValue> & Array<JsonValue>
  - nonsensible intersection

- JsonObject[key]: __type & __type.o1 & Array<JsonValue>
  - nonsensible intersection

- JsonObject[key]: __type & __type.o1 & ReadonlyArray<JsonValue>
  - nonsensible intersection

- JsonObject[key]: Array<JsonValue> & string
  - nonsensible intersection

- JsonObject[key]: Array<JsonValue> & number
  - nonsensible intersection

- JsonObject[key]: Array<JsonValue> & false
  - nonsensible intersection

- JsonObject[key]: Array<JsonValue> & true
  - nonsensible intersection

- JsonObject[key]: Array<JsonValue> & __type & __type.o1
  - nonsensible intersection

- JsonObject[key]: Array<JsonValue> & ReadonlyArray<JsonValue>
  - nonsensible intersection

- JsonObject[key]: ReadonlyArray<JsonValue> & string
  - nonsensible intersection

- JsonObject[key]: ReadonlyArray<JsonValue> & number
  - nonsensible intersection

- JsonObject[key]: ReadonlyArray<JsonValue> & false
  - nonsensible intersection

- JsonObject[key]: ReadonlyArray<JsonValue> & true
  - nonsensible intersection

- JsonObject[key]: ReadonlyArray<JsonValue> & __type & __type.o1
  - nonsensible intersection

- JsonObject[key]: ReadonlyArray<JsonValue> & Array<JsonValue>
  - nonsensible intersection
jsh: spawn typia EPERM

This code fails with this error

⏯ Playground Link

I cannot save the code to playground, so I created stackblitz environment
https://stackblitz.com/edit/stackblitz-starters-q9vn4u?file=src%2Ftemplates%2Findex.ts

💻 Code occuring the bug

import typia from 'typia';

/* the blow code a copy from 'type-fest' */
type JsonObject = { [Key in string]: JsonValue } & {
  [Key in string]?: JsonValue | undefined;
};

/**
Matches a JSON array.

@category JSON
*/
type JsonArray = JsonValue[] | readonly JsonValue[];

/**
Matches any valid JSON primitive value.

@category JSON
*/
type JsonPrimitive = string | number | boolean | null;

/**
Matches any valid JSON value.

@see `Jsonify` if you need to transform a type to one that is assignable to `JsonValue`.

@category JSON
*/
type JsonValue = JsonPrimitive | JsonObject | JsonArray;

/* copy from type-fest ends */

type T = {
  json: JsonObject;
};

export const isRequestData = typia.createIs<T>();