Created
December 3, 2018 02:09
-
-
Save FreekingDean/a7dc19ba2390cbf40386e94ea841294d to your computer and use it in GitHub Desktop.
Patch! :D
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/cmd/compile/internal/gc/subr.go b/src/cmd/compile/internal/gc/subr.go | |
index 629186829a..fabae194be 100644 | |
--- a/src/cmd/compile/internal/gc/subr.go | |
+++ b/src/cmd/compile/internal/gc/subr.go | |
@@ -1710,6 +1710,23 @@ func implements(t, iface *types.Type, m, samename **types.Field, ptr *int) bool | |
return false | |
} | |
tm := tms[i] | |
+ | |
+ for _, f := range types.ParamsResults { | |
+ // Loop over fields in structs, ignoring argument names. | |
+ fs1, fs2 := f(tm.Type).FieldSlice(), f(im.Type).FieldSlice() | |
+ if len(fs1) != len(fs2) { | |
+ return false | |
+ } | |
+ for i, f1 := range fs1 { | |
+ f2 := fs2[i] | |
+ if f2.Type.IsInterface() { | |
+ return implements(f1.Type, f2.Type, m, samename, ptr) | |
+ } | |
+ if f1.IsDDD() != f2.IsDDD() || !types.Identical(f1.Type, f2.Type) { | |
+ return false | |
+ } | |
+ } | |
+ } | |
if tm.Nointerface() || !types.Identical(tm.Type, im.Type) { | |
*m = im | |
*samename = tm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment