aboutsummaryrefslogtreecommitdiff
path: root/src/go/types/expr.go
diff options
context:
space:
mode:
authorRob Findley <rfindley@google.com>2021-06-09 18:15:10 -0400
committerRobert Findley <rfindley@google.com>2021-06-17 02:08:15 +0000
commitc7a460526eb20752d92fef0456852a3e64bc47a0 (patch)
tree87802e6f15c1db8dfc60b8b9105ad0d129aae322 /src/go/types/expr.go
parente7451f661665e406889094b9d1471c7991dfefaa (diff)
downloadgo-c7a460526eb20752d92fef0456852a3e64bc47a0.tar.gz
go-c7a460526eb20752d92fef0456852a3e64bc47a0.zip
[dev.typeparams] go/types: replace Sum type with Union type
This is a straightforward port of CL 323274 to go/types. Change-Id: Ica769d90fd482703f260f105199d2f2229498e95 Reviewed-on: https://go-review.googlesource.com/c/go/+/326677 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'src/go/types/expr.go')
-rw-r--r--src/go/types/expr.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/go/types/expr.go b/src/go/types/expr.go
index 5c65fad447..b7cc6e8ae7 100644
--- a/src/go/types/expr.go
+++ b/src/go/types/expr.go
@@ -661,8 +661,8 @@ func (check *Checker) implicitTypeAndValue(x *operand, target Type) (Type, const
default:
return nil, nil, _InvalidUntypedConversion
}
- case *_Sum:
- ok := t.is(func(t Type) bool {
+ case *Union:
+ ok := t.underIs(func(t Type) bool {
target, _, _ := check.implicitTypeAndValue(x, t)
return target != nil
})