// Type returns type which specified symbol. It goes to upper scope until
// found or returns error.
Type returns type which specified symbol. It goes to upper scope until
found or returns error.
// Type returns type which specified symbol . It goes to upper scope until // found or returns error .
func (e *Env) Type(k string) (reflect.Type, error) {
	e.RLock()
	defer e.RUnlock()
	if v, ok := e.typ[k]; ok {
		return v, nil
	}
	if e.external != nil {
		v, err := e.external.Type(k)
		if err == nil {
			return v, nil
		}
	}
	if e.parent == nil {
		if v, ok := basicTypes[k]; ok {
			return v, nil
		}
		return nilType, fmt.Errorf("undefined type '%s'", k)
	}
	return e.parent.Type(k)
}
func ( e * Env ) Type ( k string ) ( reflect . Type , error ) { e . RLock ( ) defer e . RUnlock ( ) if v , ok := e . typ [ k ] ; ok { return v , nil } if e . external != nil { v , err := e . external . Type ( k ) if err == nil { return v , nil } } if e . parent == nil { if v , ok := basicTypes [ k ] ; ok { return v , nil } return nilType , fmt . Errorf ( " " , k ) } return e . parent . Type ( k ) }
Type returns type which specified symbol.
Type returns type which specified symbol .