drewhannay
10/02/2024, 12:10 AMAbstractIrTypeSubstitutor
is used in the plugin-sandbox
“composable-like” demo, but TypeRemapper
seems to be used in the real Compose plugin. I’m trying to understand what the difference is between these two and why you’d use one over the other.dmitriy.novozhilov
10/02/2024, 7:20 AMTypeRemapper
is a task "updated types in the IR (sub)tree by given rules"
The purpose of substitutor is to update some specific type/type pattern inside some given type, e.g.
type: Map<List<T>, T>
substitution: { T -> Int }
substituted type: Map<List<Int>, Int>
As I can see, in real compose the second usecase is more relevant (underlyingRemapType, for example, replicates the logic of substitutor), so I would say the substitutor approach will be better here