[descriptors] Move DeclarationDescriptor#findPackage helper to core
There is nothing serialization-specific about this function
This commit is contained in:
committed by
teamcity
parent
dff2d2ed60
commit
5cb252fe49
@@ -105,4 +105,9 @@ fun FunctionDescriptor.isTypedEqualsInValueClass(): Boolean {
|
||||
|
||||
fun FunctionDescriptor.overridesEqualsFromAny(): Boolean = name == OperatorNameConventions.EQUALS
|
||||
&& valueParameters.size == 1 && valueParameters[0].type.isNullableAny()
|
||||
&& contextReceiverParameters.isEmpty() && extensionReceiverParameter == null
|
||||
&& contextReceiverParameters.isEmpty() && extensionReceiverParameter == null
|
||||
|
||||
tailrec fun DeclarationDescriptor.findPackage(): PackageFragmentDescriptor {
|
||||
return if (this is PackageFragmentDescriptor) this
|
||||
else this.containingDeclaration!!.findPackage()
|
||||
}
|
||||
Reference in New Issue
Block a user