-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Excessive stack depth comparing types 'SchemaTypeDef<?>' and 'SchemaTypeDef<?>' #8535
Labels
🔥high priority
packages/backend
Server side specific issue/PR
💚Refactor
Rewriting code without changing behavior
Comments
tamaina
added
packages/backend
Server side specific issue/PR
💚Refactor
Rewriting code without changing behavior
labels
Apr 23, 2022
問題なのはArrayではなくて、関数定義まわりが原因なんだと思われる |
なるほど |
この方がブランチ短い type NullOrUndefined<p extends Schema, T> =
| (p['nullable'] extends true ? null : never)
| (p['optional'] extends true ? undefined : never)
| T; |
ObjTypeを交差型でないようにしたらいけた export type ObjType<s extends Obj, RequiredProps extends keyof s> =
{ -readonly [P in keyof s]: P extends RequiredPropertyNames<RequiredProps, s> ? SchemaType<s[P]> : SchemaType<s[P]> | undefined }; ただOptionalと |
export type ObjType<s extends Obj, RequiredProps extends keyof s> =
UnionToIntersection<{
-readonly [P in keyof s]?: SchemaType<s[P]>;
} | {
-readonly [S in RequiredPropertyNames<RequiredProps, s>]: SchemaType<s[S]>;
}>; あーうん、UnionToIntersectionってTypeScriptの型検査機を騙すから、これでいけるんだよな |
これでいいか |
TypeScriptはinferで騙されるので、unionではなくintersectionを突っ込んでもおkっぽい
|
tamaina
added a commit
to tamaina/misskey
that referenced
this issue
Apr 26, 2022
Co-authored-by: acid-chicken <root@acid-chicken.com>
syuilo
pushed a commit
that referenced
this issue
Apr 27, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
🔥high priority
packages/backend
Server side specific issue/PR
💚Refactor
Rewriting code without changing behavior
#8332 由来のエラー。
admin/emoji/add-aliases-bulkのような単純な型でも発生する。
https://github.com/misskey-dev/misskey/blob/f23d5a75f4cb64328a99e25f8a17150fe5b8a4d3/packages/backend/src/server/api/endpoints/admin/emoji/add-aliases-bulk.ts
(Arrayが問題らしい?)
The text was updated successfully, but these errors were encountered: