mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-13 07:23:39 +00:00
reflect: Value.Seq iteration value types should match
Implementation of https://github.com/golang/go/issues/71905 194696f1d1f6e5609f96d0fb0192595e7e0f5b90
This commit is contained in:
@@ -197,10 +197,11 @@ func TestValueSeq(t *testing.T) {
|
||||
t.Fatalf("got %d, want %d", v.Int(), i)
|
||||
}
|
||||
i++
|
||||
// TODO: iteration should produce the same type
|
||||
// if v.Type() != reflect.TypeOf(i) {
|
||||
// t.Fatalf("got %s, want %s", v.Type(), reflect.TypeOf(i))
|
||||
// }
|
||||
if v.Type() != reflect.TypeOf(i) {
|
||||
j := ValueOf(i)
|
||||
t.Logf("ValueOf(j): %s", j.Type())
|
||||
t.Fatalf("got %s, want %s", v.Type(), reflect.TypeOf(i))
|
||||
}
|
||||
}
|
||||
if i != 4 {
|
||||
t.Fatalf("should loop four times")
|
||||
|
||||
Reference in New Issue
Block a user