Improve binary operation inference, still not great
This commit is contained in:
parent
469ce3ce77
commit
a680064b0f
@ -285,8 +285,8 @@ impl Block {
|
|||||||
let rhs_ref = state.ok(rhs_infer, rhs.1);
|
let rhs_ref = state.ok(rhs_infer, rhs.1);
|
||||||
|
|
||||||
// Try to narrow the lhs with rhs
|
// Try to narrow the lhs with rhs
|
||||||
if let (Some(mut lhs_ref), Some(rhs_ref)) = (lhs_ref, rhs_ref) {
|
if let (Some(mut lhs_ref), Some(mut rhs_ref)) = (lhs_ref, rhs_ref) {
|
||||||
lhs_ref.narrow(&rhs_ref);
|
rhs_ref.narrow(&lhs_ref);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
StmtKind::Import(_) => panic!(),
|
StmtKind::Import(_) => panic!(),
|
||||||
|
@ -366,7 +366,11 @@ impl<'outer> ScopeTypeRefs<'outer> {
|
|||||||
*idx.borrow_mut() = *hint1.0.borrow();
|
*idx.borrow_mut() = *hint1.0.borrow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
(TypeRefKind::Direct(_), TypeRefKind::BinOp(..)) => {}
|
(TypeRefKind::Direct(_), TypeRefKind::BinOp(..)) => {
|
||||||
|
if *idx == hint1.0 && idx != &hint2.0 {
|
||||||
|
*idx.borrow_mut() = *hint2.0.borrow();
|
||||||
|
}
|
||||||
|
}
|
||||||
(TypeRefKind::BinOp(..), TypeRefKind::Direct(..)) => {
|
(TypeRefKind::BinOp(..), TypeRefKind::Direct(..)) => {
|
||||||
// TODO may not be good ?
|
// TODO may not be good ?
|
||||||
// if *idx == hint2.0 && idx != &hint1.0 {
|
// if *idx == hint2.0 && idx != &hint1.0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user