You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 20, 2022. It is now read-only.
package main
func instantiate[T](p *T) {
var foo = make(map[T]int)
foo[*p] = 9
}
func main() {
instantiate[[0]byte]((*[0]byte)(nil))
}
The expected result that creation of a map with uncomparable keys is either caught at compile time, or it blows up gracefully during map creation time. Currently it does:
It might not be obvious, but the second playground link you shared shows an error coming from the Go compiler. Re-opening this because I would like the Fo compiler to catch this type of issue instead of generating invalid code and relying on the Go compiler to catch it.
(The Fo compiler works by transforming the AST into pure Go code and then calling the Go compiler).
Hello, the following does not run
https://play.folang.org/p/XhaheZsrxBT
The expected result that creation of a map with uncomparable keys is either caught at compile time, or it blows up gracefully during map creation time. Currently it does:
An engineering decision how to handle incomparable map keys is needed.
The text was updated successfully, but these errors were encountered: