mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-11 06:23:39 +00:00
reflect: Value.Set: fix direction of assignment check
This commit is contained in:
@@ -504,6 +504,15 @@ func TestTinyNumMethods(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestAssignableTo(t *testing.T) {
|
||||
var a any
|
||||
refa := ValueOf(&a).Elem()
|
||||
refa.Set(ValueOf(4))
|
||||
if got, want := refa.Interface().(int), 4; got != want {
|
||||
t.Errorf("AssignableTo / Set failed, got %v, want %v", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
func equal[T comparable](a, b []T) bool {
|
||||
if len(a) != len(b) {
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user