Map intrinsic companion objects in JavaToKotlinClassMap
Get rid of multiple usages of IntrinsicObjects where JavaToKotlinClassMap was already used, simplify code, and support loading of *CompanionObject as Kotlin built-in companions from Java code. Also fix a small bug where Boolean was considered a class with an intrinsic companion in IntrinsicObjects, although it was not
This commit is contained in:
+2
-2
@@ -35,9 +35,9 @@ class DefaultClassObjectIntrinsic(val fqName: FqName, val moduleName: String): O
|
||||
}
|
||||
}
|
||||
|
||||
public class ObjectIntrinsics : CompanionObjectMapping() {
|
||||
public class ObjectIntrinsics {
|
||||
public fun getIntrinsic(classDescriptor: ClassDescriptor): ObjectIntrinsic {
|
||||
if (!hasMappingToObject(classDescriptor)) return NO_OBJECT_INTRINSIC
|
||||
if (!CompanionObjectMapping.hasMappingToObject(classDescriptor)) return NO_OBJECT_INTRINSIC
|
||||
|
||||
val containingDeclaration = classDescriptor.getContainingDeclaration()
|
||||
val name = Name.identifier(containingDeclaration.getName().asString() + "CompanionObject")
|
||||
|
||||
Reference in New Issue
Block a user