Rework stubs for interop globals passed by value
#KT-21855 Fixed
This commit is contained in:
committed by
SvyatoslavScherbina
parent
670d05a4f3
commit
b700f96e0c
@@ -52,3 +52,6 @@ void invoke2(void (^block)(void)) {
|
||||
|
||||
int (^getSupplier(int x))(void);
|
||||
Class (^ _Nonnull getClassGetter(NSObject* obj))(void);
|
||||
|
||||
extern NSString* globalString;
|
||||
extern NSObject* globalObject;
|
||||
|
||||
@@ -48,6 +48,18 @@ fun run() {
|
||||
// toString (virtually):
|
||||
println(map.keys.map { it.toString() }.min() == foo.description())
|
||||
}
|
||||
|
||||
println(globalString)
|
||||
autoreleasepool {
|
||||
globalString = "Another global string"
|
||||
}
|
||||
println(globalString)
|
||||
|
||||
println(globalObject)
|
||||
globalObject = object : NSObject() {
|
||||
override fun description() = "global object"
|
||||
}
|
||||
println(globalObject)
|
||||
}
|
||||
|
||||
fun MutablePairProtocol.swap() {
|
||||
|
||||
@@ -57,3 +57,6 @@ int (^getSupplier(int x))(void) {
|
||||
Class (^ _Nonnull getClassGetter(NSObject* obj))() {
|
||||
return ^{ return obj.class; };
|
||||
}
|
||||
|
||||
NSString* globalString = @"Global string";
|
||||
NSObject* globalObject = nil;
|
||||
|
||||
Reference in New Issue
Block a user