Compare commits

...

1 Commits

Author SHA1 Message Date
Dhruv Manilawala
877d7e2137 [red-knot] Avoid including __all__ in the exported names 2025-05-02 14:43:09 -05:00
2 changed files with 5 additions and 2 deletions

View File

@@ -923,6 +923,9 @@ reveal_type(X) # revealed: bool
# TODO: should emit [unresolved-reference] diagnostic & reveal `Unknown`
reveal_type(Y) # revealed: bool
# error: [unresolved-reference]
reveal_type(__all__) # revealed: Unknown
```
### `__all__` with additions later on in the global scope

View File

@@ -71,10 +71,10 @@ impl<'db> ExportFinder<'db> {
}
fn possibly_add_export(&mut self, export: &'db Name, kind: PossibleExportKind) {
self.exports.insert(export, kind);
if export == "__all__" {
self.dunder_all = DunderAll::Present;
} else {
self.exports.insert(export, kind);
}
}