Commit ad5da5d
authored
bug-fix: Fix self-loop cycle detections in type-system (#1725)
Prior:
```
class Foo {
sub_foo Foo[]
}
class Bar {
foo Foo
}
```
would sometimes detect 2 cycles, `[Foo], [Foo, Bar]` but now we only
detect 1 `[Foo]`
<!-- ELLIPSIS_HIDDEN -->
----
> [!IMPORTANT]
> Fixes cycle detection in `tarjan.rs` to ensure only unique cycles are
detected, eliminating redundant cycle detections.
>
> - **Behavior**:
> - Fixes cycle detection to ensure only unique cycles are detected in
`tarjan.rs`.
> - Previously detected redundant cycles like `[Foo], [Foo, Bar]`; now
only `[Foo]` is detected.
> - **Code Changes**:
> - Removes redundant state updates in `strong_connect()` in
`tarjan.rs`.
> - Adds a test `find_cycles_names()` to verify unique cycle detection.
> - **Tests**:
> - Adds `find_cycles_names()` test to ensure only unique cycles are
detected.
> - Updates existing tests to reflect the new cycle detection behavior.
>
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=BoundaryML%2Fbaml&utm_source=github&utm_medium=referral)<sup>
for 35aa210. It will automatically
update as commits are pushed.</sup>
<!-- ELLIPSIS_HIDDEN -->1 parent 5a93b0d commit ad5da5d
1 file changed
Lines changed: 55 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
128 | 133 | | |
129 | 134 | | |
130 | 135 | | |
| |||
139 | 144 | | |
140 | 145 | | |
141 | 146 | | |
142 | | - | |
143 | | - | |
144 | 147 | | |
145 | 148 | | |
146 | 149 | | |
| |||
150 | 153 | | |
151 | 154 | | |
152 | 155 | | |
153 | | - | |
154 | | - | |
155 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
156 | 159 | | |
157 | 160 | | |
158 | 161 | | |
| |||
236 | 239 | | |
237 | 240 | | |
238 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
239 | 289 | | |
240 | 290 | | |
241 | 291 | | |
| |||
0 commit comments