In type assertion at compile time, compare signatures between function types only. Make `itype.numOut()` return the correct value for Go builtins (this was not strictly necessary due to above fix, but it is correct and improves maintainability). Fixes #1454.
23 lines
209 B
Go
23 lines
209 B
Go
package main
|
|
|
|
type I2 interface {
|
|
I2() string
|
|
}
|
|
|
|
type I interface {
|
|
I2
|
|
}
|
|
|
|
type S struct{}
|
|
|
|
func (*S) I2() string { return "foo" }
|
|
|
|
func main() {
|
|
var i I
|
|
_, ok := i.(*S)
|
|
println(ok)
|
|
}
|
|
|
|
// Output:
|
|
// false
|