Skip to content

Commit

Permalink
add helper to get effective argument labels of composite type initial…
Browse files Browse the repository at this point in the history
…izer
  • Loading branch information
turbolent committed Sep 21, 2023
1 parent 01d6790 commit 9160ec4
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions runtime/sema/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -4795,6 +4795,22 @@ func (t *CompositeType) InitializerFunctionType() *FunctionType {
}
}

func (t *CompositeType) InitializerEffectiveArgumentLabels() []string {
parameters := t.ConstructorParameters
if len(parameters) == 0 {
return nil
}

argumentLabels := make([]string, 0, len(parameters))
for _, parameter := range parameters {
argumentLabels = append(
argumentLabels,
parameter.EffectiveArgumentLabel(),
)
}
return argumentLabels
}

// Member

type Member struct {
Expand Down

0 comments on commit 9160ec4

Please sign in to comment.