Exporting a generic arrow function that returns a type triggers TS7056: The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed. This only occurs when the function is exported as an arrow function. An equivalent function declaration does not error. Compiling directly with typescript@6.0 does not reproduce the issue.
Steps to reproduce
Repo link
Behavior with typescript@6.0
No error.
Behavior with tsgo
src/example.ts:5:14 - error TS7056: The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.
5 export const SortableQuery = <S extends TEnum>({
~~~~~~~~~~~~~
Found 1 error in src/example.ts:5
Exporting a generic arrow function that returns a type triggers
TS7056: The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.This only occurs when the function is exported as an arrow function. An equivalent function declaration does not error. Compiling directly with typescript@6.0 does not reproduce the issue.Steps to reproduce
Repo link
Behavior with
typescript@6.0No error.
Behavior with
tsgo