Browse Source

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

pull/3548/head
Damian Gryski 2 years ago
committed by Ayke
parent
commit
e0aee1f23c
  1. 5
      src/reflect/type.go

5
src/reflect/type.go

@ -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")
}

Loading…
Cancel
Save