Commit bcb563f4 authored by Kunpei Sakai's avatar Kunpei Sakai Committed by Matthew Dempsky

cmd/compile: allow converting defined string types to []rune

Fixes #23298

Change-Id: I107c6f3a80db83f063c0daf262c6e7f7492e4d4c
Reviewed-on: https://go-review.googlesource.com/87695
Run-TryBot: Kunpei Sakai <namusyaka@gmail.com>
Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
parent f04eebfd
......@@ -1665,7 +1665,7 @@ opswitch:
a = nod(OADDR, temp(t), nil)
}
n = mkcall("stringtoslicerune", n.Type, init, a, n.Left)
n = mkcall("stringtoslicerune", n.Type, init, a, conv(n.Left, types.Types[TSTRING]))
// ifaceeq(i1 any-1, i2 any-2) (ret bool);
case OCMPIFACE:
......
// compile
// Copyright 2018 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package p
type T string
var (
t = T("T")
r = []rune(t)
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment