(
self,
vars: list[TypeVarId],
constraints: list[Constraint],
graph: Graph,
lowers: Bounds,
uppers: Bounds,
)
| 265 | assert_equal(actual_free, free_vars) |
| 266 | |
| 267 | def assert_transitive_closure( |
| 268 | self, |
| 269 | vars: list[TypeVarId], |
| 270 | constraints: list[Constraint], |
| 271 | graph: Graph, |
| 272 | lowers: Bounds, |
| 273 | uppers: Bounds, |
| 274 | ) -> None: |
| 275 | actual_graph, actual_lowers, actual_uppers = transitive_closure(vars, constraints) |
| 276 | # Add trivial elements. |
| 277 | for v in vars: |
| 278 | graph.add((v, v)) |
| 279 | assert_equal(actual_graph, graph) |
| 280 | assert_equal(dict(actual_lowers), lowers) |
| 281 | assert_equal(dict(actual_uppers), uppers) |
| 282 | |
| 283 | def supc(self, type_var: TypeVarType, bound: Type) -> Constraint: |
| 284 | return Constraint(type_var, SUPERTYPE_OF, bound) |
no test coverage detected