Introduce KClass-based cache for KPackageFragment

* It is a heavy-weight object that is hard to compute
* It is being constructed each type _cached_ method ref is used in equals/hashCode
* Module name is deliberately ignored, corresponding doc is added where appropriate 

#KT-48136

Merge-request: KT-MR-6817
Merged-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
This commit is contained in:
Vsevolod Tolstopyatov
2022-08-08 15:57:56 +00:00
committed by Space
parent 28310eb970
commit c6cbab43f7
8 changed files with 63 additions and 6 deletions
@@ -52,6 +52,7 @@ public class Reflection {
}
public static KDeclarationContainer getOrCreateKotlinPackage(Class javaClass, String moduleName) {
// This signature cannot be removed as it is used in FunctionReferenceLowering.kt non-directly
return factory.getOrCreateKotlinPackage(javaClass, moduleName);
}