-
Notifications
You must be signed in to change notification settings - Fork 10
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
[BUG] $$typeToString ellipsizes type information #74
Comments
Can you send me the types used in the snippet that causes the ellipsization? I can't replicate it. |
OK, I have tried to collect them from the various imports of that source file:
I think I have extracted everything so that the snippet should compile; let me know if I have missed anything. Thanks! |
Awesome! Looking forward to the next release ;-) |
It's already available in v2.4.2! |
Thanks! Did you actually publish to npm? npm still reports v2.4.1 as latest version. |
That's really weird... the action which handles publishing errored with I'll be releasing a minor version really soon (most likely by the end of the week), all changes from 2.4.2 will be included in that release! |
👍 For the time being I'm using the code straight from Github instead of npm, so I'm not blocked. |
Describe the bug
For complex types, $$typeToString replaces parts of the type description with
...
Code to reproduce
These are the same examples as in #73. I am using the following macro to reflect the types of arrow functions that I am exporting:
It works fine on
where
square.reflectedType
ends up getting the very reasonable value<T>(dep: { multiply: (a: T, b: T) => T; }) => (z: T) => T
. However, onit produces
sqrt.reflectedType
equal to<T>(dep: { unaryMinus: (a: RealType<T>) => RealType<T>; conservativeSqrt: (a: RealType<T>) => RealType<T>; equal: (a: RealType<T>, b: RealType<...>) => boolean; } & { ...; } & { ...; } & { ...; }) => (a: Complex<...>) => Complex<...>
so we have lost much of the type information to those ellipses.
Expected behavior
I would like there to be a way to force $$typeToString to produce the entire description of the typescript type of its template argument, without any ellipsization.
Additional context
Typescript 5.1.6, ts-macros 2.4.1, ts-patch 3.0.2
The text was updated successfully, but these errors were encountered: