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

Add '#[ts(bound)]' attribute #269

Merged
merged 10 commits into from
Mar 18, 2024

Conversation

NyxCode
Copy link
Collaborator

@NyxCode NyxCode commented Mar 14, 2024

No description provided.

Copy link
Collaborator Author

@NyxCode NyxCode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WilsonGramer Looks good! Could you add docs for it (type doc of TS)?

Comment on lines 335 to 344
let where_bound = bounds.map_or_else(
|| {
let bounds = generate_where_clause(generics, dependencies);
quote! { #bounds }
},
|bounds| {
let bounds = syn::parse_str::<TokenStream>(bounds).expect("malformed `bounds`");
quote! { where #bounds }
},
);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd prefer a match here. No problem if you prefer map_or_else, though.

@escritorio-gustavo
Copy link
Contributor

Hey @WilsonGramer! I have made some changes to improve error locations and opened a PR to your fork (this PR has maintainer edits disabled), please check it out WilsonGramer#1

@escritorio-gustavo escritorio-gustavo linked an issue Mar 14, 2024 that may be closed by this pull request
@WilsonGramer
Copy link
Contributor

@NyxCode I added the docs and merged in @escritorio-gustavo's changes — let me know if anything else needs to be done!

@NyxCode
Copy link
Collaborator Author

NyxCode commented Mar 17, 2024

I'm happy with this, thanks!

@escritorio-gustavo escritorio-gustavo merged commit a1b8389 into Aleph-Alpha:main Mar 18, 2024
7 checks passed
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

Successfully merging this pull request may close these issues.

Feature request: #[ts(bound)] attribute
3 participants