compiler: fix named string to []byte slice conversion

This was missing a `.Underlying()` call to avoid testing the named type
(but instead test for the underlying type).
This commit is contained in:
Ayke van Laethem
2020-07-27 12:35:29 +02:00
committed by Ron Evans
parent e41e5106cc
commit d4e04e4e49
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -17,8 +17,11 @@ func testRunesToString(r []rune) {
println("string from runes:", string(r))
}
type myString string
func main() {
testRangeString()
testStringToRunes()
testRunesToString([]rune{97, 98, 99, 252, 162, 8364, 66376, 176, 120})
var _ = len([]byte(myString("foobar"))) // issue 1246
}