mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-06 12:03:41 +00:00
compiler: allow slices of empty structs.
Fixes https://github.com/tinygo-org/tinygo/issues/2749
This commit is contained in:
Vendored
+3
@@ -19,6 +19,9 @@ func main() {
|
||||
printslice("foo[1:2]", foo[1:2])
|
||||
println("sum foo:", sum(foo))
|
||||
|
||||
// creating a slice of uncommon base type
|
||||
assert(len(make([]struct{}, makeInt(4))) == 4)
|
||||
|
||||
// creating a slice with uncommon len, cap types
|
||||
assert(len(make([]int, makeInt(2), makeInt(3))) == 2)
|
||||
assert(len(make([]int, makeInt8(2), makeInt8(3))) == 2)
|
||||
|
||||
Reference in New Issue
Block a user