Skip to content

Commit 2e74785

Browse files
author
Ben Krieger
committed
reflect: make types AssignableTo when they share their underlying type
1 parent 05e2f5d commit 2e74785

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/reflect/type.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ func (t *rawType) FieldAlign() int {
976976
// AssignableTo returns whether a value of type t can be assigned to a variable
977977
// of type u.
978978
func (t *rawType) AssignableTo(u Type) bool {
979-
if u := u.(*rawType); t == u || t.underlying() == u || t == u.underlying() {
979+
if t.underlying() == u.(*rawType).underlying() {
980980
return true
981981
}
982982

0 commit comments

Comments
 (0)