cf849835ba
Intercept decompiler calls to process files that belong to classpath builtins from K2 IDE differently. Their content won't be filtered w.r.t. JVM logic during decompilation. Split stub versions for .kotlin_builtins with K1 and K2 IDE. K2 currently uses a single shared symbol provider for builtins of all platforms. KotlinBuiltInDecompiler filters out duplicated declarations contained in JVM classfiles as required for K1. For K2 this logic doesn't fit: non-JVM modules (common, in particular) rely on .kotlin_builtins, because kotlin-stdlib-common doesn't contain .kotlin_builtins or .knm files for some of the built-in declarations (e.g., kotlin.Unit). IDE has to restore the missing declarations using built-ins from classloader. Filtering declarations from there using K1 logic breaks resolution of these declarations inside common modules in IDE. The change shouldn't affect JVM modules as are able to resolve all builtin symbols from the standard library before falling back to built-ins. KT-61757