[ObjCExport] Add failing member function signature order test
KT-66066
This commit is contained in:
committed by
Space Team
parent
e6705e9db2
commit
468efc77dd
+7
-1
@@ -19,7 +19,13 @@ internal val StableFunctionOrder: Comparator<KtFunctionSymbol>
|
||||
{ it.isConstructor },
|
||||
{ it.name },
|
||||
{ it.valueParameters.size },
|
||||
// TODO NOW! { KonanManglerDesc.run { it.signatureString(false) } }
|
||||
/**
|
||||
* Signature order should be added
|
||||
*
|
||||
* See KT-66066
|
||||
* [org.jetbrains.kotlin.backend.konan.objcexport.ObjCExportTranslatorKt.makeMethodsOrderStable]
|
||||
* { KonanManglerDesc.run { it.signatureString(false) } }
|
||||
*/
|
||||
)
|
||||
|
||||
internal val StableClassifierOrder: Comparator<KtClassifierSymbol> =
|
||||
|
||||
+9
@@ -312,6 +312,15 @@ class ObjCExportHeaderGeneratorTest(private val generator: HeaderGenerator) {
|
||||
doTest(headersTestDataDir.resolve("vararg"))
|
||||
}
|
||||
|
||||
/**
|
||||
* KT-66066
|
||||
*/
|
||||
@Test
|
||||
@TodoAnalysisApi
|
||||
fun `test - member function signature order`() {
|
||||
doTest(headersTestDataDir.resolve("memberFunctionSignatureOrder"))
|
||||
}
|
||||
|
||||
private fun doTest(root: File, configuration: Configuration = Configuration()) {
|
||||
if (!root.isDirectory) fail("Expected ${root.absolutePath} to be directory")
|
||||
val generatedHeaders = generator.generateHeaders(root, configuration).toString()
|
||||
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSError.h>
|
||||
#import <Foundation/NSObject.h>
|
||||
#import <Foundation/NSSet.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wunknown-warning-option"
|
||||
#pragma clang diagnostic ignored "-Wincompatible-property-type"
|
||||
#pragma clang diagnostic ignored "-Wnullability"
|
||||
|
||||
#pragma push_macro("_Nullable_result")
|
||||
#if !__has_feature(nullability_nullable_result)
|
||||
#undef _Nullable_result
|
||||
#define _Nullable_result _Nullable
|
||||
#endif
|
||||
|
||||
__attribute__((objc_subclassing_restricted))
|
||||
@interface Foo : Base
|
||||
- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer));
|
||||
+ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead")));
|
||||
- (void)fooA:(NSString *)a b:(int32_t)b __attribute__((swift_name("foo(a:b:)")));
|
||||
- (void)fooB:(NSString *)b a:(NSString *)a __attribute__((swift_name("foo(b:a:)")));
|
||||
@end
|
||||
|
||||
#pragma pop_macro("_Nullable_result")
|
||||
#pragma clang diagnostic pop
|
||||
NS_ASSUME_NONNULL_END
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
class Foo {
|
||||
fun foo(b: String, a: String) = Unit
|
||||
fun foo(a: String, b: Int) = Unit
|
||||
}
|
||||
Reference in New Issue
Block a user