gopherjs
gopherjs copied to clipboard
Compiler panic when computing array lengths
I found following examples that cause the compiler to panic:
Example 1: [compiler panic] Unhandled len type: *types.Array
package main
func a() *[1]byte {
println("side effect")
return nil
}
func main() {
println(len(*a()))
}
Example 2: [compiler panic] interface conversion: interface is int64, not int
.
Note that return value of a()
is no longer dereferenced.
package main
func a() *[1]byte {
println("side effect")
return nil
}
func main() {
println(len(a()))
}
I expect there are similar problems with cap()
.