New interface to Typer: the function TypeName() returns a more readable type name

This commit is contained in:
2024-05-19 02:23:28 +02:00
parent 9967918418
commit b92b19e1dd
4 changed files with 37 additions and 3 deletions
+8
View File
@@ -90,6 +90,14 @@ func (dict *DictType) ToString(opt FmtOpt) string {
return sb.String()
}
func (dict *DictType) String() string {
return dict.ToString(0)
}
func (dict *DictType) TypeName() string {
return "dict"
}
func (dict *DictType) hasKey(target any) (ok bool) {
for key := range *dict {
if ok = reflect.DeepEqual(key, target); ok {