mirror of
https://github.com/golang/go
synced 2024-11-11 22:50:22 -07:00
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: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
parent
f04eebfdf5
commit
bcb563f4db
@ -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:
|
||||
|
14
test/fixedbugs/issue23298.go
Normal file
14
test/fixedbugs/issue23298.go
Normal file
@ -0,0 +1,14 @@
|
||||
// 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)
|
||||
)
|
Loading…
Reference in New Issue
Block a user