mcpiroman
09/11/2021, 10:25 AMval symRemapper = DeepCopySymbolRemapper()
val moduleCopy = DeepCopyIrTreeWithSymbols(symRemapper, DeepCopyTypeRemapper(symRemapper)).visitModuleFragment(module)
But it gives me java.lang.IllegalArgumentException: Non-remapped symbol FILE fqName:kotlin.ranges
Youssef Shoaib [MOD]
09/11/2021, 7:06 PMmcpiroman
09/11/2021, 7:16 PMYoussef Shoaib [MOD]
09/11/2021, 7:52 PMIrExpression
. In that case I was thinking off, it can still refer to outside symbols. In your case, you can just do module.deepCopyWithSymbols()
and that should do the trickshikasd
09/12/2021, 5:27 PMsymbolRemapper.visitModule
before copying it (it needs to find the symbols before executing the copy)
As Youssef suggested before, .deepCopyWithSymbols
should work for you here