reflect: Type.AssignableTo(): you can assign anything to interface{}

This commit is contained in:
Damian Gryski
2023-03-11 14:11:03 -08:00
committed by Ayke
parent ad9f790dfc
commit e0aee1f23c
+5
View File
@@ -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")
}