Skip to content

add support for top level as#288

Merged
escritorio-gustavo merged 3 commits intoAleph-Alpha:mainfrom
dr-bonez:feature/top-level-as
Apr 2, 2024
Merged

add support for top level as#288
escritorio-gustavo merged 3 commits intoAleph-Alpha:mainfrom
dr-bonez:feature/top-level-as

Conversation

@dr-bonez
Copy link
Copy Markdown
Contributor

@dr-bonez dr-bonez commented Apr 1, 2024

Goal

This adds support for easily defining a struct or enum's type definition manually at the top level using the as = ".." attribute. This is for symmetry with #286.

Changes

Added type_as to the container attributes, and defined an early-returned implementation for if this attribute is specified

Checklist

  • I have followed the steps listed in the Contributing guide.
  • If necessary, I have added documentation related to the changes made.
  • I have added or updated the tests related to the changes made.

Comment thread macros/src/types/type_as.rs
Copy link
Copy Markdown
Contributor

@escritorio-gustavo escritorio-gustavo left a comment

Choose a reason for hiding this comment

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

LGTM! @NyxCode, do you want to change anything?

@NyxCode
Copy link
Copy Markdown
Collaborator

NyxCode commented Apr 2, 2024

Hope you guys had a nice easter!

I love it! Seems like a natural extension after supporting #[ts(type = "..")] on types. Thanks @dr-bonez for the PR, and thanks @escritorio-gustavo for taking a look!

@escritorio-gustavo escritorio-gustavo merged commit c862aa6 into Aleph-Alpha:main Apr 2, 2024
@escritorio-gustavo
Copy link
Copy Markdown
Contributor

Hope you guys had a nice easter!

Thanks! Hope you did as well!

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.

3 participants