// Stringify returns a string representation of the given type that
// is suitable for debugging purposes.
Stringify returns a string representation of the given type that
is suitable for debugging purposes.
// Stringify returns a string representation of the given type that // is suitable for debugging purposes .
func (e *Engine) Stringify(id TypeID) string {
	if id == 0 {
		return "<NIL>"
	}
	ret := strings.Builder{}
	td := e.typeData(id)
	for {
		switch td.Kind {
		case KindInterface, KindStruct:
			if ret.Len() == 0 {
				return td.Name
			}
			ret.WriteString(td.Name)
			return ret.String()
		case KindPointer:
			ret.WriteRune('*')
			td = td.elemData
		case KindSlice:
			ret.WriteString("[]")
			td = td.elemData
		default:
			panic(fmt.Errorf("unsupported: %d", td.Kind))
		}
	}
}
func ( e * Engine ) Stringify ( id TypeID ) string { if id == 0 { return " " } ret := strings . Builder { } td := e . typeData ( id ) for { switch td . Kind { case KindInterface , KindStruct : if ret . Len ( ) == 0 { return td . Name } ret . WriteString ( td . Name ) return ret . String ( ) case KindPointer : ret . WriteRune ( '*' ) td = td . elemData case KindSlice : ret . WriteString ( " " ) td = td . elemData default : panic ( fmt . Errorf ( " " , td . Kind ) ) } } }
Stringify returns a string representation of the given type that
is suitable for debugging purposes.
Stringify returns a string representation of the given type that is suitable for debugging purposes .