tinygo-org / tinygo

Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.
https://tinygo.org
Other
15.25k stars 900 forks source link

`reflect.Value` methods `Seq` and `Seq2` missing #4487

Open jmillikin opened 15 hours ago

jmillikin commented 15 hours ago

These two methods are new in Go 1.23 as part of the new iterators feature:

% cat main.go 
package main

import "reflect"

func main() {
    var v reflect.Value
    _ = v.Seq
    _ = v.Seq2
}
% go build -o main
% tinygo build -o main
# example.com/example
main.go:7:8: v.Seq undefined (type reflect.Value has no field or method Seq)
main.go:8:8: v.Seq2 undefined (type reflect.Value has no field or method Seq2)
dgryski commented 3 hours ago

Implementing this means pulling in https://github.com/golang/go/blob/master/src/reflect/iter.go and https://github.com/golang/go/tree/master/src/iter

(Edit: which due to import cycles probably means properly splitting out bits of reflect into a internal/reflectlite.)