blob: 510ff091d927cd991b62d53c8a96cbac5f4fe817 [file] [log] [blame]
// +build ignore
package main
import "reflect"
var a, b int
type A struct {
f *int
g interface{}
h bool
}
func structReflect1() {
var a A
fld, _ := reflect.TypeOf(a).FieldByName("f") // "f" is ignored
// TODO(adonovan): what does interface{} even mean here?
print(reflect.Zero(fld.Type).Interface()) // @concrete *int | bool | interface{}
// TODO(adonovan): test promotion/embedding.
}
func main() {
structReflect1()
}