Minor, extract isDeprecatedHidden for usage in codegen
Also remove a hundred year old TODO
This commit is contained in:
@@ -231,15 +231,14 @@ public class AsmUtil {
|
|||||||
int flags = getVisibilityAccessFlag(functionDescriptor);
|
int flags = getVisibilityAccessFlag(functionDescriptor);
|
||||||
flags |= getVarargsFlag(functionDescriptor);
|
flags |= getVarargsFlag(functionDescriptor);
|
||||||
flags |= getDeprecatedAccessFlag(functionDescriptor);
|
flags |= getDeprecatedAccessFlag(functionDescriptor);
|
||||||
if (DeprecationUtilKt.isHiddenInResolution(functionDescriptor)
|
if (DeprecationUtilKt.isDeprecatedHidden(functionDescriptor)
|
||||||
|| functionDescriptor instanceof PropertyAccessorDescriptor
|
|| functionDescriptor instanceof PropertyAccessorDescriptor
|
||||||
&& DeprecationUtilKt.isHiddenInResolution(((PropertyAccessorDescriptor) functionDescriptor).getCorrespondingProperty())) {
|
&& DeprecationUtilKt.isDeprecatedHidden(((PropertyAccessorDescriptor) functionDescriptor).getCorrespondingProperty())) {
|
||||||
flags |= ACC_SYNTHETIC;
|
flags |= ACC_SYNTHETIC;
|
||||||
}
|
}
|
||||||
return flags;
|
return flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: move mapping logic to front-end java
|
|
||||||
public static int getVisibilityAccessFlag(@NotNull MemberDescriptor descriptor) {
|
public static int getVisibilityAccessFlag(@NotNull MemberDescriptor descriptor) {
|
||||||
Integer specialCase = specialCaseVisibility(descriptor);
|
Integer specialCase = specialCaseVisibility(descriptor);
|
||||||
if (specialCase != null) {
|
if (specialCase != null) {
|
||||||
|
|||||||
@@ -183,11 +183,15 @@ enum class DeprecationLevelValue {
|
|||||||
WARNING, ERROR, HIDDEN
|
WARNING, ERROR, HIDDEN
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun DeclarationDescriptor.isDeprecatedHidden(): Boolean {
|
||||||
|
return getDeprecation()?.deprecationLevel == DeprecationLevelValue.HIDDEN
|
||||||
|
}
|
||||||
|
|
||||||
@JvmOverloads
|
@JvmOverloads
|
||||||
fun DeclarationDescriptor.isHiddenInResolution(isSuperCall: Boolean = false): Boolean {
|
fun DeclarationDescriptor.isHiddenInResolution(isSuperCall: Boolean = false): Boolean {
|
||||||
if (this is FunctionDescriptor) {
|
if (this is FunctionDescriptor) {
|
||||||
if (isHiddenToOvercomeSignatureClash) return true
|
if (isHiddenToOvercomeSignatureClash) return true
|
||||||
if (isHiddenForResolutionEverywhereBesideSupercalls && !isSuperCall) return true
|
if (isHiddenForResolutionEverywhereBesideSupercalls && !isSuperCall) return true
|
||||||
}
|
}
|
||||||
return getDeprecation()?.deprecationLevel == DeprecationLevelValue.HIDDEN
|
return isDeprecatedHidden()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user