Add entity.FormatType()

This commit is contained in:
Sasha Koshka 2024-02-12 14:34:49 -05:00
parent 7d2f435d18
commit cb3e5b6bfb
1 changed files with 10 additions and 0 deletions

View File

@ -208,3 +208,13 @@ func TypesEqual (left, right Type) bool {
if left == nil { return true }
return left.Equals(right)
}
// FormatType returns a string representing a type. If the type is nil, it
// returns "Void".
func FormatType (ty Type) string {
if ty == nil {
return "Void"
} else {
return ty.String()
}
}