mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-06 12:03:41 +00:00
reflect: Type.AssignableTo(): you can assign anything to interface{}
This commit is contained in:
@@ -795,6 +795,11 @@ func (t *rawType) AssignableTo(u Type) bool {
|
||||
if t == u.(*rawType) {
|
||||
return true
|
||||
}
|
||||
|
||||
if u.Kind() == Interface && u.NumMethod() == 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
if u.Kind() == Interface {
|
||||
panic("reflect: unimplemented: AssignableTo with interface")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user