Fix string pattern matching in mir interpreter

This commit is contained in:
hkalbasi 2023-06-02 23:45:29 +03:30
parent dfaca9398a
commit aab7589c40
6 changed files with 84 additions and 12 deletions

View file

@ -829,7 +829,7 @@ impl<'ctx> MirLowerCtx<'ctx> {
op,
BinaryOp::ArithOp(ArithOp::Shl | ArithOp::Shr) | BinaryOp::Assignment { op: Some(ArithOp::Shl | ArithOp::Shr) }
);
lhs_ty.as_builtin().is_some() && rhs_ty.as_builtin().is_some() && (lhs_ty == rhs_ty || builtin_inequal_impls)
lhs_ty.is_scalar() && rhs_ty.is_scalar() && (lhs_ty == rhs_ty || builtin_inequal_impls)
};
if !is_builtin {
if let Some((func_id, generic_args)) = self.infer.method_resolution(expr_id) {