Skip to content

Conversation

@Zxilly
Copy link

@Zxilly Zxilly commented Jun 2, 2025

This patch provides corresponding parsing support for CL https://go.dev/cl/677915, which is currently under review.

@Zxilly Zxilly marked this pull request as draft June 2, 2025 17:07
Copy link
Member

@aarzilli aarzilli left a comment

Choose a reason for hiding this comment

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

Please disregards my comments here until the linker change is merged, I don't want you to do work that has to be changed later.

ctyp.initialized = true
slices.SortFunc(ctyp.values, func(a, b constantValue) int {
return cmp.Compare(a.value, b.value)
return cmp.Compare(a.value.ExactString(), b.value.ExactString())
Copy link
Member

Choose a reason for hiding this comment

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

Numbers shouldn't be sorted as string (nor should we do a conversion to string to sort numbers). I think that storing everything as a constant.Value is probably a mistake, strings and ints should stay in different fields.

return ctyp
}

func (ctyp *constantType) describe(n int64) string {
Copy link
Member

Choose a reason for hiding this comment

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

This function should be changed to also handle string constants.

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.

2 participants