Check there are only linear constraints between type variables in SCC. Linear are constraints like T <: S (while T <: F[S] are non-linear).
(scc: set[TypeVarId], lowers: Bounds, uppers: Bounds)
| 516 | |
| 517 | |
| 518 | def check_linear(scc: set[TypeVarId], lowers: Bounds, uppers: Bounds) -> bool: |
| 519 | """Check there are only linear constraints between type variables in SCC. |
| 520 | |
| 521 | Linear are constraints like T <: S (while T <: F[S] are non-linear). |
| 522 | """ |
| 523 | for tv in scc: |
| 524 | if any(get_vars(lt, list(scc)) for lt in lowers[tv]): |
| 525 | return False |
| 526 | if any(get_vars(ut, list(scc)) for ut in uppers[tv]): |
| 527 | return False |
| 528 | return True |
| 529 | |
| 530 | |
| 531 | def skip_reverse_union_constraints(cs: list[Constraint]) -> list[Constraint]: |
no test coverage detected
searching dependent graphs…