IR, descriptors: remove (Ir)ExternalOverridabilityCondition.Result.CONFLICT
No existing external overridability condition reports a conflict anyway, and there's no support for it in the IR case.
This commit is contained in:
committed by
Space Team
parent
c63f31f92f
commit
9b5c331c8e
+1
-4
@@ -10,7 +10,6 @@ import org.jetbrains.kotlin.ir.declarations.IrOverridableMember
|
||||
interface IrExternalOverridabilityCondition {
|
||||
enum class Result {
|
||||
OVERRIDABLE,
|
||||
CONFLICT,
|
||||
INCOMPATIBLE,
|
||||
UNKNOWN
|
||||
}
|
||||
@@ -26,8 +25,6 @@ interface IrExternalOverridabilityCondition {
|
||||
*
|
||||
* - [Result.OVERRIDABLE] means that it is definitely overridable, and neither the general override checking algorithm, nor other
|
||||
* external overridability conditions can refute that.
|
||||
* - [Result.CONFLICT] means that it is an error to have both declarations available in the same class, so the compiler should report
|
||||
* an error.
|
||||
* - [Result.INCOMPATIBLE] means that it is not overridable, but it's OK to have both declarations available in the same class because
|
||||
* they don't cause a conflict.
|
||||
* - [Result.UNKNOWN] means that this overridability condition cannot claim anything about the overridability, and the final result
|
||||
@@ -42,7 +39,7 @@ interface IrExternalOverridabilityCondition {
|
||||
* Specifies what values can be returned by [isOverridable]. Used as an optimization to reorder overridability conditions to prevent
|
||||
* redundant calculations.
|
||||
*
|
||||
* - [Contract.CONFLICTS_ONLY] means that [isOverridable] can return [Result.CONFLICT], [Result.INCOMPATIBLE] or [Result.UNKNOWN].
|
||||
* - [Contract.CONFLICTS_ONLY] means that [isOverridable] can return [Result.INCOMPATIBLE] or [Result.UNKNOWN].
|
||||
* - [Contract.SUCCESS_ONLY] means that [isOverridable] can return [Result.OVERRIDABLE] or [Result.UNKNOWN].
|
||||
* - [Contract.BOTH] means that [isOverridable] can return any result.
|
||||
*/
|
||||
|
||||
@@ -158,7 +158,6 @@ class IrOverrideChecker(
|
||||
externalCondition.isOverridable(superMember, subMember)
|
||||
when (result) {
|
||||
OVERRIDABLE -> wasSuccess = true
|
||||
CONFLICT -> return conflict("External condition failed")
|
||||
INCOMPATIBLE -> return incompatible("External condition")
|
||||
UNKNOWN -> {}
|
||||
}
|
||||
@@ -173,7 +172,6 @@ class IrOverrideChecker(
|
||||
val result =
|
||||
externalCondition.isOverridable(superMember, subMember)
|
||||
when (result) {
|
||||
CONFLICT -> return conflict("External condition failed")
|
||||
INCOMPATIBLE -> return incompatible("External condition")
|
||||
OVERRIDABLE -> error(
|
||||
"Contract violation in ${externalCondition.javaClass} condition. It's not supposed to end with success"
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ import org.jetbrains.kotlin.descriptors.ClassDescriptor;
|
||||
|
||||
public interface ExternalOverridabilityCondition {
|
||||
enum Result {
|
||||
OVERRIDABLE, CONFLICT, INCOMPATIBLE, UNKNOWN
|
||||
OVERRIDABLE, INCOMPATIBLE, UNKNOWN
|
||||
}
|
||||
|
||||
enum Contract {
|
||||
|
||||
@@ -258,8 +258,6 @@ public class OverridingUtil {
|
||||
case OVERRIDABLE:
|
||||
wasSuccess = true;
|
||||
break;
|
||||
case CONFLICT:
|
||||
return OverrideCompatibilityInfo.conflict("External condition failed");
|
||||
case INCOMPATIBLE:
|
||||
return OverrideCompatibilityInfo.incompatible("External condition");
|
||||
case UNKNOWN:
|
||||
@@ -280,8 +278,6 @@ public class OverridingUtil {
|
||||
ExternalOverridabilityCondition.Result result =
|
||||
externalCondition.isOverridable(superDescriptor, subDescriptor, subClassDescriptor);
|
||||
switch (result) {
|
||||
case CONFLICT:
|
||||
return OverrideCompatibilityInfo.conflict("External condition failed");
|
||||
case INCOMPATIBLE:
|
||||
return OverrideCompatibilityInfo.incompatible("External condition");
|
||||
case OVERRIDABLE:
|
||||
|
||||
Reference in New Issue
Block a user