Skip to content

Conversation

ydnar
Copy link
Contributor

@ydnar ydnar commented Mar 14, 2025

This PR adds Go 1.24 iter support to package reflect.

  • Type.CanSeq and Type.CanSeq2
  • Value.Seq and Value.Seq2

Fixes #4487.

aykevl and others added 4 commits March 13, 2025 11:13
This avoids a dependency on the reflect package.

I've tried to deduplicate as much as reasonably possible, while keeping
the code clean. Especially some tricky methods for the reflect.Type type
have a shared implementation (using //go:linkname). In other cases, I've
simply used the same type using a type alias, in the other direction
(the reflect package now imports the internal/reflectlite package
instead of the other way around).
This avoids a circular dependency.
@ydnar ydnar self-assigned this Mar 14, 2025
// for i := range 4 {
// f(i, i+1)
// }
// }), func(t *testing.T, s iter.Seq2[Value, Value]) {
Copy link
Member

Choose a reason for hiding this comment

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

Are these supposed to be commented?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

TinyGo reflect doesn't support functions so I disabled those tests.

@deadprogram
Copy link
Member

This PR will also address #4487

@ydnar ydnar changed the base branch from reflectlite-rewrite to dev March 17, 2025 18:23
@ydnar
Copy link
Contributor Author

ydnar commented Mar 17, 2025

Implemented in #4787.

@ydnar ydnar closed this Mar 17, 2025
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