Skip to content

Commit

Permalink
go/ir: permit conversion of '[]byte | string' to []byte and string
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikh committed Mar 30, 2022
1 parent fd737ab commit a34f635
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions go/ir/emit.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,8 @@ func emitConv(f *Function, val Value, t_dst types.Type, source ast.Node) Value {
// A representation-changing conversion?
// At least one of {ut_src,ut_dst} must be *Basic.
// (The other may be []byte or []rune.)
ok1 := tset_src.All(func(term *typeparams.Term) bool { _, ok := term.Type().Underlying().(*types.Basic); return ok })
ok2 := tset_dst.All(func(term *typeparams.Term) bool { _, ok := term.Type().Underlying().(*types.Basic); return ok })
ok1 := tset_src.Any(func(term *typeparams.Term) bool { _, ok := term.Type().Underlying().(*types.Basic); return ok })
ok2 := tset_dst.Any(func(term *typeparams.Term) bool { _, ok := term.Type().Underlying().(*types.Basic); return ok })
if ok1 || ok2 {
c := &Convert{X: val}
c.setType(t_dst)
Expand Down

0 comments on commit a34f635

Please sign in to comment.