[FIR, IR] Convert FirDefaultArgumentsInExpectActualizedByFakeOverrideChecker into ExpectActualCheckingCompatibility
FirDefaultArgumentsInExpectActualizedByFakeOverrideChecker is an adhoc checker which can be converted to ExpectActualCheckingCompatibility to reuse common expect-actual checking infrastructure. ^KT-62913 Fixed Review: https://jetbrains.team/p/kt/reviews/13094/timeline Tests that were broken by one of my previous commits are now fixed: - actualFakeOverride_paramsAreCompatibleViaSharedMethodWithDefaultParams.kt - inheritedJavaMembers.kt DEFAULT_ARGUMENTS_IN_EXPECT_ACTUALIZED_BY_FAKE_OVERRIDE diagnostic disappeared in delegation.fir.kt because only one AbstractExpectActualChecker incompatibility can be reported at a time (DEFAULT_ARGUMENTS_IN_EXPECT_ACTUALIZED_BY_FAKE_OVERRIDE is now reported not by adhoc checker but by common AbstractExpectActualChecker). It would be nice to report both of them, but it's a separate issue KT-62631 delegation2 test makes sure that DEFAULT_ARGUMENTS_IN_EXPECT_ACTUALIZED_BY_FAKE_OVERRIDE is reported when NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS is fixed
This commit is contained in:
+2
@@ -69,6 +69,8 @@ sealed class ExpectActualCheckingCompatibility<out D> : ExpectActualCompatibilit
|
||||
Incompatible<Nothing>("some modifiers on expected declaration are missing on the actual one (infix, inline, operator)")
|
||||
object ActualFunctionWithDefaultParameters :
|
||||
Incompatible<Nothing>("actual function cannot have default argument values, they should be declared in the expected function")
|
||||
object DefaultArgumentsInExpectActualizedByFakeOverride :
|
||||
Incompatible<Nothing>("default argument values inside expect declaration are not allowed for methods actualized via fake override")
|
||||
|
||||
// Properties
|
||||
object PropertyKind : Incompatible<Nothing>("property kinds are different (val vs var)")
|
||||
|
||||
Reference in New Issue
Block a user