From 676ffff015e06469cc7e3cf3f4b3faf0ff1b168d Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Tue, 10 Mar 2020 12:59:54 +0100 Subject: [PATCH] Minor, fix builtinFunctionReferenceOwner.kt for android-tests In codegen tests on Android, everything is being run with kotlin-reflect in the classpath. So a package is no longer represented by a reflect-less PackageReference, but by a full-blown KPackageImpl. Use a less specific supertype ClassBasedDeclarationContainer instead, the one which is a supertype of both PackageReference and KPackageImpl, and which still allows to get the underlying jClass. --- .../box/callableReference/builtinFunctionReferenceOwner.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/testData/codegen/box/callableReference/builtinFunctionReferenceOwner.kt b/compiler/testData/codegen/box/callableReference/builtinFunctionReferenceOwner.kt index 98a81858b1d..82665c10923 100644 --- a/compiler/testData/codegen/box/callableReference/builtinFunctionReferenceOwner.kt +++ b/compiler/testData/codegen/box/callableReference/builtinFunctionReferenceOwner.kt @@ -5,7 +5,7 @@ fun box(): String { val f = Any?::toString - val owner = (f as kotlin.jvm.internal.CallableReference).owner as kotlin.jvm.internal.PackageReference + val owner = (f as kotlin.jvm.internal.CallableReference).owner as kotlin.jvm.internal.ClassBasedDeclarationContainer if (owner.jClass.name != "kotlin.jvm.internal.Intrinsics\$Kotlin") return "Fail: $owner" return "OK"