compiler: permit converting unnamed types when ignoring struct tags
Test case is https://golang.org/cl/375796.
Fixes golang/go#50439
Change-Id: I2c77b456cccb706a77710ccb3963d4e10d387cc4
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/375797
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
diff --git a/go/types.cc b/go/types.cc
index 57c02a9..1c67ea0 100644
--- a/go/types.cc
+++ b/go/types.cc
@@ -791,8 +791,7 @@
// The types are convertible if they have identical underlying
// types, ignoring struct field tags.
- if ((lhs->named_type() != NULL || rhs->named_type() != NULL)
- && Type::are_identical(lhs->base(), rhs->base(), 0, reason))
+ if (Type::are_identical(lhs->base(), rhs->base(), 0, reason))
return true;
// The types are convertible if they are both unnamed pointer types