mirror of https://github.com/golang/go.git
[dev.go2go] go/types: add internal TODO for future simplification
Change-Id: I8e4e8eebf8c64962ccf5f0e225dd007f691c373a Reviewed-on: https://go-review.googlesource.com/c/go/+/239384 Reviewed-by: Robert Griesemer <gri@golang.org>
This commit is contained in:
parent
dfb538cec8
commit
6ca930a00a
|
|
@ -513,6 +513,9 @@ func (check *Checker) convertUntyped(x *operand, target Type) {
|
|||
|
||||
// In case of a type parameter, conversion must succeed against
|
||||
// all types enumerated by the type parameter bound.
|
||||
// TODO(gri) We should not need this because we have the code
|
||||
// for Sum types in convertUntypedInternal. But at least one
|
||||
// test fails. Investigate.
|
||||
if t := target.TypeParam(); t != nil {
|
||||
types := t.Bound().allTypes
|
||||
if types == nil {
|
||||
|
|
@ -585,6 +588,11 @@ func (check *Checker) convertUntypedInternal(x *operand, target Type) {
|
|||
goto Error
|
||||
}
|
||||
}
|
||||
case *Sum:
|
||||
t.is(func(t Type) bool {
|
||||
check.convertUntypedInternal(x, t)
|
||||
return x.mode != invalid
|
||||
})
|
||||
case *Interface:
|
||||
// Update operand types to the default type rather then
|
||||
// the target (interface) type: values must have concrete
|
||||
|
|
|
|||
Loading…
Reference in New Issue