File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -513,6 +513,9 @@ func (check *Checker) convertUntyped(x *operand, target Type) {
513
513
514
514
// In case of a type parameter, conversion must succeed against
515
515
// all types enumerated by the type parameter bound.
516
+ // TODO(gri) We should not need this because we have the code
517
+ // for Sum types in convertUntypedInternal. But at least one
518
+ // test fails. Investigate.
516
519
if t := target .TypeParam (); t != nil {
517
520
types := t .Bound ().allTypes
518
521
if types == nil {
@@ -585,6 +588,11 @@ func (check *Checker) convertUntypedInternal(x *operand, target Type) {
585
588
goto Error
586
589
}
587
590
}
591
+ case * Sum :
592
+ t .is (func (t Type ) bool {
593
+ check .convertUntypedInternal (x , t )
594
+ return x .mode != invalid
595
+ })
588
596
case * Interface :
589
597
// Update operand types to the default type rather then
590
598
// the target (interface) type: values must have concrete
You can’t perform that action at this time.
0 commit comments