Revise TypeInfo::ty usage

This commit is contained in:
Lukas Wirth 2021-08-03 17:24:43 +02:00
parent 25ff7171c4
commit 8afa2722b2
18 changed files with 30 additions and 29 deletions

View file

@ -100,11 +100,11 @@ impl TypeInfo {
self.ty
}
pub fn coerced(self) -> Option<Type> {
self.coerced
pub fn has_coercion(&self) -> bool {
self.coerced.is_some()
}
pub fn coerced_or_original(self) -> Type {
pub fn coerced(self) -> Type {
self.coerced.unwrap_or(self.ty)
}
}