I see `AbstractIrTypeSubstitutor` is used in the `...
# compiler
d
I see
AbstractIrTypeSubstitutor
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.
d
The main usecase for
TypeRemapper
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.
Copy code
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
thank you color 1