github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/gnovm/tests/files/map1.gno (about)

     1  package main
     2  
     3  func main() {
     4  	type s struct{}
     5  	m := map[s]int{
     6  		{}: 1,
     7  		{}: 2,
     8  	}
     9  	// NOTE(tb): surprisingly, this code doesn't trigger any error in go, whereas
    10  	// the resulting map has only one item (the last one).
    11  }
    12  
    13  // Error:
    14  // duplicate key struct{} in map literal