mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-12 15:03:41 +00:00
reflect: implement Type.AssignableTo
This commit is contained in:
committed by
Ron Evans
parent
b8cd8b6f25
commit
614433cb75
@@ -388,12 +388,8 @@ func (v Value) Set(x Value) {
|
||||
if !v.indirect {
|
||||
panic("reflect: value is not addressable")
|
||||
}
|
||||
if v.Type() != x.Type() {
|
||||
if v.Kind() == Interface {
|
||||
panic("reflect: unimplemented: assigning to interface of different type")
|
||||
} else {
|
||||
panic("reflect: cannot assign")
|
||||
}
|
||||
if !v.Type().AssignableTo(x.Type()) {
|
||||
panic("reflect: cannot set")
|
||||
}
|
||||
size := v.Type().Size()
|
||||
xptr := x.value
|
||||
|
||||
Reference in New Issue
Block a user