Skip to content

Commit

Permalink
reflect: make types AssignableTo when they share their underlying type
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-krieger committed Oct 28, 2024
1 parent c146705 commit 192b1ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/reflect/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ func (t *rawType) FieldAlign() int {
// AssignableTo returns whether a value of type t can be assigned to a variable
// of type u.
func (t *rawType) AssignableTo(u Type) bool {
if u := u.(*rawType); t == u || t.underlying() == u || t == u.underlying() {
if t.underlying() == u.(*rawType).underlying() {
return true
}

Expand Down

0 comments on commit 192b1ff

Please sign in to comment.