[ObjCInterop] Implement @ObjCSignatureOverride
This annotation leads to conflicting overloads error supression,
in case where several function with the same argument types,
but different argument names are inherited from ObjC class.
We need to implement it in both K1 and K2 to make the IDE experience
better.
But the annotation itself wouldn't be available in K1.
^KT-61323
This commit is contained in:
committed by
Space Team
parent
77eee0d3fc
commit
6e8a7d4662
+1
-1
@@ -119,7 +119,7 @@ class Bar : Foo() {
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("CONFLICTING_OVERLOADS")
|
||||
@Suppress("CONFLICTING_OBJC_OVERLOADS")
|
||||
class MutablePairImpl(first: Int, second: Int) : NSObject(), MutablePairProtocol {
|
||||
private var elements = intArrayOf(first, second)
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ class Bar : Foo() {
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("CONFLICTING_OVERLOADS")
|
||||
@Suppress("CONFLICTING_OBJC_OVERLOADS")
|
||||
class MutablePairImpl(first: Int, second: Int) : NSObject(), MutablePairProtocol {
|
||||
private var elements = intArrayOf(first, second)
|
||||
|
||||
|
||||
+18
@@ -66,6 +66,18 @@ public class DiagnosticsNativeTestGenerated extends AbstractDiagnosticsNativeTes
|
||||
runTest("compiler/testData/diagnostics/nativeTests/nativeProtectedFunCall.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("noObjcOverrideConflictingOverloadsDisabled.kt")
|
||||
public void testNoObjcOverrideConflictingOverloadsDisabled() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/nativeTests/noObjcOverrideConflictingOverloadsDisabled.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("noObjcOverrideConflictingOverloadsEnabled.kt")
|
||||
public void testNoObjcOverrideConflictingOverloadsEnabled() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/nativeTests/noObjcOverrideConflictingOverloadsEnabled.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("objCName.kt")
|
||||
public void testObjCName() throws Exception {
|
||||
@@ -102,6 +114,12 @@ public class DiagnosticsNativeTestGenerated extends AbstractDiagnosticsNativeTes
|
||||
runTest("compiler/testData/diagnostics/nativeTests/objCRefinement.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("objcOverrideApplicability.kt")
|
||||
public void testObjcOverrideApplicability() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/nativeTests/objcOverrideApplicability.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("resolveToDelegatedProperty.kt")
|
||||
public void testResolveToDelegatedProperty() throws Exception {
|
||||
|
||||
+18
@@ -70,6 +70,18 @@ public class FirLightTreeOldFrontendNativeDiagnosticsTestGenerated extends Abstr
|
||||
runTest("compiler/testData/diagnostics/nativeTests/nativeProtectedFunCall.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("noObjcOverrideConflictingOverloadsDisabled.kt")
|
||||
public void testNoObjcOverrideConflictingOverloadsDisabled() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/nativeTests/noObjcOverrideConflictingOverloadsDisabled.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("noObjcOverrideConflictingOverloadsEnabled.kt")
|
||||
public void testNoObjcOverrideConflictingOverloadsEnabled() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/nativeTests/noObjcOverrideConflictingOverloadsEnabled.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("objCName.kt")
|
||||
public void testObjCName() throws Exception {
|
||||
@@ -106,6 +118,12 @@ public class FirLightTreeOldFrontendNativeDiagnosticsTestGenerated extends Abstr
|
||||
runTest("compiler/testData/diagnostics/nativeTests/objCRefinement.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("objcOverrideApplicability.kt")
|
||||
public void testObjcOverrideApplicability() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/nativeTests/objcOverrideApplicability.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("resolveToDelegatedProperty.kt")
|
||||
public void testResolveToDelegatedProperty() throws Exception {
|
||||
|
||||
+18
@@ -70,6 +70,18 @@ public class FirPsiOldFrontendNativeDiagnosticsTestGenerated extends AbstractFir
|
||||
runTest("compiler/testData/diagnostics/nativeTests/nativeProtectedFunCall.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("noObjcOverrideConflictingOverloadsDisabled.kt")
|
||||
public void testNoObjcOverrideConflictingOverloadsDisabled() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/nativeTests/noObjcOverrideConflictingOverloadsDisabled.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("noObjcOverrideConflictingOverloadsEnabled.kt")
|
||||
public void testNoObjcOverrideConflictingOverloadsEnabled() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/nativeTests/noObjcOverrideConflictingOverloadsEnabled.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("objCName.kt")
|
||||
public void testObjCName() throws Exception {
|
||||
@@ -106,6 +118,12 @@ public class FirPsiOldFrontendNativeDiagnosticsTestGenerated extends AbstractFir
|
||||
runTest("compiler/testData/diagnostics/nativeTests/objCRefinement.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("objcOverrideApplicability.kt")
|
||||
public void testObjcOverrideApplicability() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/nativeTests/objcOverrideApplicability.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("resolveToDelegatedProperty.kt")
|
||||
public void testResolveToDelegatedProperty() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user