• Russ Cox's avatar
    reflect: add Type.Implements, Type.AssignableTo, Value.CallSlice; make Set match Go · e1ee3b5d
    Russ Cox authored
    This CL makes reflect require that values be assignable to the target type
    in exactly the same places where that is the rule in Go.  It also adds
    the Implements and AssignableTo methods so that callers can check
    the types themselves so as to avoid a panic.
    
    Before this CL, reflect required strict type identity.
    
    This CL expands Call to accept and correctly marshal arbitrary
    argument lists for variadic functions; it introduces CallSlice for use
    in the case where the slice for the variadic argument is already known.
    
    Fixes #327.
    Fixes #1212.
    
    R=r, dsymonds
    CC=golang-dev
    https://golang.org/cl/4439058
    e1ee3b5d
type.go 25.5 KB