mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-07 12:33:42 +00:00
compiler: support constant indices with a named type
This commit is contained in:
committed by
Ron Evans
parent
81c0f9af4e
commit
01e58691a1
Vendored
+7
@@ -2,6 +2,13 @@ package main
|
||||
|
||||
type MySlice [32]byte
|
||||
|
||||
type myUint8 uint8
|
||||
|
||||
// Indexing into slice with named type (regression test).
|
||||
var array = [4]int{
|
||||
myUint8(2): 3,
|
||||
}
|
||||
|
||||
func main() {
|
||||
l := 5
|
||||
foo := []int{1, 2, 4, 5}
|
||||
|
||||
Reference in New Issue
Block a user