Skip to content

Commit 4adcc42

Browse files
author
Ben Krieger
committed
reflect: make types AssignableTo when they share their underlying type
1 parent c58dca4 commit 4adcc42

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
@@ -997,7 +997,7 @@ func (t *rawType) FieldAlign() int {
997997
// AssignableTo returns whether a value of type t can be assigned to a variable
998998
// of type u.
999999
func (t *rawType) AssignableTo(u Type) bool {
1000-
if u := u.(*rawType); t == u || t.underlying() == u || t == u.underlying() {
1000+
if t.underlying() == u.(*rawType).underlying() {
10011001
return true
10021002
}
10031003

0 commit comments

Comments
 (0)