Revert possibly-unbound changes
This commit is contained in:
@@ -69,8 +69,6 @@ if coinflip():
|
||||
```
|
||||
|
||||
```py
|
||||
# TODO: We should potentially distinguish between possibly-unbound and possibly-undeclared here:
|
||||
# error: [possibly-unbound-import]
|
||||
from maybe_undeclared import x
|
||||
|
||||
reveal_type(x) # revealed: int
|
||||
|
||||
@@ -90,7 +90,12 @@ fn symbol_by_id<'db>(db: &'db dyn Db, scope: ScopeId<'db>, symbol: ScopedSymbolI
|
||||
|
||||
match inferred {
|
||||
// Symbol is possibly undeclared and definitely unbound
|
||||
Symbol::Unbound => Symbol::Type(declared_ty, Boundness::PossiblyUnbound),
|
||||
Symbol::Unbound => {
|
||||
// TODO: We probably don't want to report `Bound` here. This requires a bit of
|
||||
// design work though as we might want a different behavior for stubs and for
|
||||
// normal modules.
|
||||
Symbol::Type(declared_ty, Boundness::Bound)
|
||||
}
|
||||
// Symbol is possibly undeclared and (possibly) bound
|
||||
Symbol::Type(inferred_ty, boundness) => Symbol::Type(
|
||||
UnionType::from_elements(db, [inferred_ty, declared_ty].iter().copied()),
|
||||
|
||||
Reference in New Issue
Block a user