Always build a union of inferred_ty and declared_ty
This commit is contained in:
@@ -90,12 +90,10 @@ fn symbol_by_id<'db>(db: &'db dyn Db, scope: ScopeId<'db>, symbol: ScopedSymbolI
|
||||
match inferred_ty {
|
||||
// Symbol is possibly undeclared and definitely unbound
|
||||
Symbol::Unbound => Symbol::Type(declared_ty, Boundness::Bound),
|
||||
// Symbol is possibly undeclared and definitely bound
|
||||
inferred @ Symbol::Type(_, Boundness::Bound) => inferred,
|
||||
// Symbol is possibly undeclared and possibly unbound
|
||||
Symbol::Type(inferred_ty, Boundness::PossiblyUnbound) => Symbol::Type(
|
||||
UnionType::from_elements(db, [declared_ty, inferred_ty].iter().copied()),
|
||||
Boundness::PossiblyUnbound,
|
||||
// Symbol is possibly undeclared and (possibly) bound
|
||||
Symbol::Type(inferred_ty, boundness) => Symbol::Type(
|
||||
UnionType::from_elements(db, [inferred_ty, declared_ty].iter().copied()),
|
||||
boundness,
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user