Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion type_tuple.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func (p *CodeBuilder) IsTupleType(typ types.Type) bool {
func checkTupleType(typ types.Type) (result *types.Struct) {
result, _ = typ.Underlying().(*types.Struct)
if result != nil {
if result.NumFields() > 0 && result.Field(0).Name() != tupleFieldName(0) {
if result.NumFields() > 0 && result.Field(0).Name() != tupleField0 {
result = nil
}
}
Expand Down Expand Up @@ -207,6 +207,8 @@ func (p *Package) NewTuple(withName bool, fields ...*types.Var) *types.Struct {
return ret
}

const tupleField0 = "X_0"

func tupleFieldName(i int) string {
return "X_" + strconv.Itoa(i)
}
Expand Down
Loading