Skip to content

Commit a34f635

Browse files
committed
go/ir: permit conversion of '[]byte | string' to []byte and string
1 parent fd737ab commit a34f635

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

go/ir/emit.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,8 @@ func emitConv(f *Function, val Value, t_dst types.Type, source ast.Node) Value {
282282
// A representation-changing conversion?
283283
// At least one of {ut_src,ut_dst} must be *Basic.
284284
// (The other may be []byte or []rune.)
285-
ok1 := tset_src.All(func(term *typeparams.Term) bool { _, ok := term.Type().Underlying().(*types.Basic); return ok })
286-
ok2 := tset_dst.All(func(term *typeparams.Term) bool { _, ok := term.Type().Underlying().(*types.Basic); return ok })
285+
ok1 := tset_src.Any(func(term *typeparams.Term) bool { _, ok := term.Type().Underlying().(*types.Basic); return ok })
286+
ok2 := tset_dst.Any(func(term *typeparams.Term) bool { _, ok := term.Type().Underlying().(*types.Basic); return ok })
287287
if ok1 || ok2 {
288288
c := &Convert{X: val}
289289
c.setType(t_dst)

0 commit comments

Comments
 (0)