diff options
author | Ayke van Laethem <[email protected]> | 2020-07-27 12:35:29 +0200 |
---|---|---|
committer | Ron Evans <[email protected]> | 2020-07-29 12:13:37 +0200 |
commit | d4e04e4e493aa4a99659361e28b22ecd51cceee3 (patch) | |
tree | 484d986b73f6e75a38732527816f8f310bd09a72 /testdata/string.go | |
parent | e41e5106cca28d9ccfb976dc38562ab08388c09f (diff) | |
download | tinygo-d4e04e4e493aa4a99659361e28b22ecd51cceee3.tar.gz tinygo-d4e04e4e493aa4a99659361e28b22ecd51cceee3.zip |
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).
Diffstat (limited to 'testdata/string.go')
-rw-r--r-- | testdata/string.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/testdata/string.go b/testdata/string.go index 1c5ce6300..7eb90173c 100644 --- a/testdata/string.go +++ b/testdata/string.go @@ -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 } |