diff options
author | Konstantin Yegupov <[email protected]> | 2019-01-03 08:02:44 +0000 |
---|---|---|
committer | Ayke van Laethem <[email protected]> | 2019-01-04 15:55:57 +0100 |
commit | f44dff6f59782a33ebaa33761643fbbfd6a29cb6 (patch) | |
tree | 94acaecd52d17f0e17c16a11b53a90d10cd0cd24 /testdata | |
parent | 873c1c3b4d04bb34639924ab871093d76a669a58 (diff) | |
download | tinygo-f44dff6f59782a33ebaa33761643fbbfd6a29cb6.tar.gz tinygo-f44dff6f59782a33ebaa33761643fbbfd6a29cb6.zip |
compiler: allow slicing arrays of a named type
Diffstat (limited to 'testdata')
-rw-r--r-- | testdata/slice.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/testdata/slice.go b/testdata/slice.go index ad59f7eec..cf0fd216d 100644 --- a/testdata/slice.go +++ b/testdata/slice.go @@ -1,5 +1,7 @@ package main +type MySlice [32]byte + func main() { l := 5 foo := []int{1, 2, 4, 5} @@ -89,6 +91,12 @@ func main() { print(" ", n) } println() + + // Verify the fix in https://github.com/aykevl/tinygo/pull/119 + var unnamed [32]byte + var named MySlice + assert(len(unnamed[:]) == 32) + assert(len(named[:]) == 32) } func printslice(name string, s []int) { |