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

Support aliased and inlined struct type enum variants #1531

Closed
worstell opened this issue May 17, 2024 · 0 comments · Fixed by #1535 or #1563
Closed

Support aliased and inlined struct type enum variants #1531

worstell opened this issue May 17, 2024 · 0 comments · Fixed by #1535 or #1563
Assignees

Comments

@worstell
Copy link
Contributor

both of the below will be supported ways of declaring struct type enum variants:

type TypeEnum interface {
   typeenum()
}

type Inlined struct {
}
func (Inlined) typeenum()

type Aliased Underlying {
}
func (Aliased) typeenum()

type Underlying struct {
}

producing the following schema:

enum TypeEnum {
   Inlined foo.Inlined
   Aliased foo.Underlying
}

if the struct is inlined, we will use its name as both the variant name and the type name. right now, we're only supporting the inlined case correctly

@worstell worstell self-assigned this May 17, 2024
@ftl-robot ftl-robot mentioned this issue May 17, 2024
worstell added a commit that referenced this issue May 18, 2024
small changes + fixes preempting the refactor

fixes #1531, #1527, #1496
matt2e pushed a commit that referenced this issue May 23, 2024
small changes + fixes preempting the refactor

fixes #1531, #1527, #1496
matt2e added a commit that referenced this issue May 23, 2024
Un-reverting #1535 by @worstell 
small changes + fixes preempting the refactor

fixes #1531,
#1527,
#1496

Co-authored-by: worstell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant