Make IsInstance return proper bool, fixes GH-3686. (#3688)
* Make IsInstance return proper bool, fixes GH-3686. * Proper fix.
This commit is contained in:
+1
-1
@@ -911,7 +911,7 @@ internal class CAdapterGenerator(val context: Context) : DeclarationDescriptorVi
|
||||
|KObjHeader* DerefStablePointer(void*, KObjHeader**) RUNTIME_NOTHROW;
|
||||
|void* CreateStablePointer(KObjHeader*) RUNTIME_NOTHROW;
|
||||
|void DisposeStablePointer(void*) RUNTIME_NOTHROW;
|
||||
|int IsInstance(const KObjHeader*, const KTypeInfo*) RUNTIME_NOTHROW;
|
||||
|${prefix}_KBoolean IsInstance(const KObjHeader*, const KTypeInfo*) RUNTIME_NOTHROW;
|
||||
|void EnterFrame(KObjHeader** start, int parameters, int count) RUNTIME_NOTHROW;
|
||||
|void LeaveFrame(KObjHeader** start, int parameters, int count) RUNTIME_NOTHROW;
|
||||
|void Kotlin_initRuntimeIfNeeded();
|
||||
|
||||
@@ -3675,6 +3675,8 @@ dynamicTest("produce_dynamic") {
|
||||
"singleton = I am single\n" +
|
||||
"mutable = foo\n" +
|
||||
"topLevel = 777 3\n" +
|
||||
"IsInstance1 = PASS\n" +
|
||||
"IsInstance2 = PASS\n" +
|
||||
"getVector128 = (1, 2, 3, 4)\n" +
|
||||
"Error handler: kotlin.Error: Expected error\n"
|
||||
}
|
||||
|
||||
@@ -70,6 +70,9 @@ int main(void) {
|
||||
|
||||
__ kotlin.root.testNullableWithNulls(nullableIntNull, nullableUnitNull);
|
||||
|
||||
printf("IsInstance1 = %s\n", __ IsInstance(singleton.pinned, __ kotlin.root.Singleton._type()) ? "PASS" : "FAIL");
|
||||
printf("IsInstance2 = %s\n", !(__ IsInstance(singleton.pinned, __ kotlin.root.Codeable._type())) ? "PASS" : "FAIL");
|
||||
|
||||
testVector128();
|
||||
|
||||
__ DisposeStablePointer(singleton.pinned);
|
||||
|
||||
Reference in New Issue
Block a user