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

Macro Support and Generics #1257

Open
bradleat opened this issue Sep 6, 2024 · 0 comments
Open

Macro Support and Generics #1257

bradleat opened this issue Sep 6, 2024 · 0 comments

Comments

@bradleat
Copy link

bradleat commented Sep 6, 2024

I believe that typia should support "macros" as supported by the bun and parcel bundlers.

In this bundling support typia.createIs<T>() can replace itself with the output function.

Howeover, the greatest support should be the addition of generic support for typia within macro calls. For instance, if the user has a macro function fetch:


export function fetch<T>() {

/// does some stuff

cont result: unknown = // ... use your imagination

const isResult = typia.is<T>(result);

if (isResult === false) throw 'wrong type`;

return result

}

In the example, fetch is itself a macro funtion, so for every use of it, it will be inlined and T can be known. Therefore, typia would gain support for use within generics in macros.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant