Revert "Getting DeepEqual to work with maps whose key is an interface (#4360)"

This reverts commit 1fd75ffbda.

The change is not correct and allows code to continue while it should
panic. For details, see:
https://github.com/tinygo-org/tinygo/pull/4360#issuecomment-2252943012
This commit is contained in:
Ayke van Laethem
2024-07-26 16:56:42 +02:00
committed by Ayke
parent 1fd75ffbda
commit 6184a6cd35
2 changed files with 1 additions and 19 deletions
+1 -3
View File
@@ -982,9 +982,7 @@ func (v Value) MapIndex(key Value) Value {
vkey := v.typecode.key()
// compare key type with actual key type of map
// AssignableTo is not implemented for interfaces
// avoid: "reflect: unimplemented: AssignableTo with interface"
if vkey.Kind() != Interface && !key.typecode.AssignableTo(vkey) {
if !key.typecode.AssignableTo(vkey) {
// type error?
panic("reflect.Value.MapIndex: incompatible types for key")
}