Commit fe31273
Fix redex class merge test
Summary:
```
In Kotlin 2.2, the Kotlin compiler generates additional local variable slots for flatMapIndexed$1 (2 more fields: L$2, L$3), changing its field count from 7 to 9. This changes its shape from (0,5,0,2,0,0,0) to (0,7,0,2,0,0,0).
Kotlin 2.1 (7 fields each):
- flatMapIndexed$1 → shape (0,5,0,2,0,0,0)
- runningReduceIndexed$1 → shape (0,5,0,2,0,0,0)
- Both in same shape group → CAN BE MERGED
Kotlin 2.2 (different field counts):
- flatMapIndexed$1 → shape (0,7,0,2,0,0,0) with 9 fields
- runningReduceIndexed$1 → shape (0,5,0,2,0,0,0) with 7 fields
- Different shape groups → runningReduceIndexed$1 is alone → CANNOT BE MERGED
The Fix
Updated the test to verify flatMapIndexed$1 and runningFoldIndexed$1 instead, as these two classes share the same shape (0,7,0,2,0,0,0) in Kotlin 2.2 and CAN be merged together.
```
```
Kotlin 2.1 shapes:
flatMapIndexed$1 -> (0,5,0,2,0,0,0)
runningFoldIndexed$1 -> (0,6,0,2,0,0,0)
runningReduceIndexed$1 -> (0,5,0,2,0,0,0)
runningReduce$1 -> (0,5,0,1,0,0,0)
zipWithNext$2 -> (0,5,0,1,0,0,0)
children$1 -> (0,4,0,1,0,0,0)
shuffled$1 -> (0,4,0,1,0,0,0)
ifEmpty$1 -> (0,3,0,1,0,0,0)
Kotlin 2.2 shapes:
flatMapIndexed$1 -> (0,7,0,2,0,0,0) # changed!
runningFoldIndexed$1 -> (0,7,0,2,0,0,0) # changed!
runningReduceIndexed$1 -> (0,5,0,2,0,0,0) # same
runningReduce$1 -> (0,5,0,1,0,0,0) # same
zipWithNext$2 -> (0,6,0,1,0,0,0) # changed!
children$1 -> (0,4,0,1,0,0,0) # same
shuffled$1 -> (0,6,0,2,0,0,0) # changed!
ifEmpty$1 -> (0,4,0,1,0,0,0) # changed!
```
Reviewed By: xuhdev
Differential Revision: D89639868
fbshipit-source-id: ac944dafc2dd31deb5a1ccc3459995c7812cab881 parent 6fa47fb commit fe31273
1 file changed
+19
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
14 | | - | |
15 | | - | |
16 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
17 | 33 | | |
18 | 34 | | |
19 | 35 | | |
| |||
0 commit comments