ruff/crates/red_knot_python_semantic/src
Carl Meyer 811f78d94d
[red-knot] small efficiency improvements and bugfixes to use-def map building (#12373)
Adds inference tests sufficient to give full test coverage of the
`UseDefMapBuilder::merge` method.

In the process I realized that we could implement visiting of if
statements in `SemanticBuilder` with fewer `snapshot`, `restore`, and
`merge` operations, so I restructured that visit a bit.

I also found one correctness bug in the `merge` method (it failed to
extend the given snapshot with "unbound" for any missing symbols,
meaning we would just lose the fact that the symbol could be unbound in
the merged-in path), and two efficiency bugs (if one of the ranges to
merge is empty, we can just use the other one, no need for copies, and
if the ranges are overlapping -- which can occur with nested branches --
we can still just merge them with no copies), and fixed all three.
2024-07-18 09:24:58 -07:00
..
semantic_index [red-knot] small efficiency improvements and bugfixes to use-def map building (#12373) 2024-07-18 09:24:58 -07:00
types [red-knot] small efficiency improvements and bugfixes to use-def map building (#12373) 2024-07-18 09:24:58 -07:00
ast_node_ref.rs [red-knot] per-definition inference, use-def maps (#12269) 2024-07-16 11:02:30 -07:00
db.rs [red-knot] per-definition inference, use-def maps (#12269) 2024-07-16 11:02:30 -07:00
lib.rs [red-knot] intern types using Salsa (#12061) 2024-07-05 12:16:37 -07:00
node_key.rs [red-knot] Extract `red_knot_python_semantic` crate (#11926) 2024-06-20 13:24:24 +02:00
semantic_index.rs [red-knot] better docs for use-def maps (#12357) 2024-07-17 17:50:58 -07:00
semantic_model.rs [red-knot] Add basic workspace support (#12318) 2024-07-17 11:34:21 +02:00
types.rs [red-knot] better docs for type inference (#12356) 2024-07-17 13:36:58 -07:00