Closed
Description
For: $ cat test.go package main import "io" func main() { var y interface { Read() } _ = y.(io.Reader) } Neither compiler complains: $ gccgo test.go $ go tool 6g test.go And according to the spec it is a valid program. However, any concrete value assigned to y must implement Read(), and thus cannot possibly implement io.Reader.Read. Thus, this type assertion will fail and we know this at compile time. The spec should require this check and compilers should implement it. This would be a backward-incompatible language change, albeit with a very small chance of actually breaking existing code.