mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-07 20:43:40 +00:00
compiler: implement operations on nil hashmaps
* comparing a map against nil * getting the length of a nil map
This commit is contained in:
Vendored
+5
@@ -26,6 +26,11 @@ func main() {
|
||||
readMap(testmap2, "seven")
|
||||
lookup(testmap2, "eight")
|
||||
lookup(testmap2, "nokey")
|
||||
|
||||
// operations on nil maps
|
||||
var nilmap map[string]int
|
||||
println(m == nil, m != nil, len(m))
|
||||
println(nilmap == nil, nilmap != nil, len(nilmap))
|
||||
}
|
||||
|
||||
func readMap(m map[string]int, key string) {
|
||||
|
||||
Reference in New Issue
Block a user