The detection of special cases of interpreter functions and interfaces is more precise. It allows at least to complete parsing of code where type is derived from a type assertion expression. Fixes #770.
26 lines
260 B
Go
26 lines
260 B
Go
package main
|
|
|
|
import "reflect"
|
|
|
|
type I interface {
|
|
Foo() int
|
|
}
|
|
|
|
type T struct {
|
|
Name string
|
|
}
|
|
|
|
func (t T) Foo() int { return 0 }
|
|
|
|
func f(v reflect.Value) int {
|
|
i := v.Interface().(I)
|
|
return i.Foo()
|
|
}
|
|
|
|
func main() {
|
|
println("hello")
|
|
}
|
|
|
|
// Output:
|
|
// hello
|