fix tests

This commit is contained in:
Cameron 2022-10-22 06:23:23 +01:00
parent 5b56d7bd90
commit 3dd2f99c49
6 changed files with 117 additions and 6 deletions

View file

@ -2857,6 +2857,13 @@ impl Type {
matches!(self.ty.kind(Interner), TyKind::Scalar(Scalar::Uint(UintTy::Usize)))
}
pub fn is_int_or_uint(&self) -> bool {
match self.ty.kind(Interner) {
TyKind::Scalar(Scalar::Int(_) | Scalar::Uint(_)) => true,
_ => false,
}
}
pub fn remove_ref(&self) -> Option<Type> {
match &self.ty.kind(Interner) {
TyKind::Ref(.., ty) => Some(self.derived(ty.clone())),