Files
moxa/_test/issue-1454.go
Marc Vertes 021824930d interp: improve type assertions
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.
2022-09-12 22:30:08 +02:00

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