FIR: Fix VerifyError caused by private delegates
^KT-45048 Fixed
This commit is contained in:
+6
@@ -12674,6 +12674,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/kt9712.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("privateInSubClass.kt")
|
||||
public void testPrivateInSubClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/privateInSubClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("privateSetterKPropertyIsNotMutable.kt")
|
||||
public void testPrivateSetterKPropertyIsNotMutable() throws Exception {
|
||||
|
||||
+14
-14
@@ -284,10 +284,6 @@ abstract class AbstractFirStatusResolveTransformer(
|
||||
return when (declaration) {
|
||||
is FirCallableDeclaration<*> -> {
|
||||
when (declaration) {
|
||||
is FirProperty -> {
|
||||
declaration.getter?.let { transformPropertyAccessor(it, data) }
|
||||
declaration.setter?.let { transformPropertyAccessor(it, data) }
|
||||
}
|
||||
is FirFunction<*> -> {
|
||||
for (valueParameter in declaration.valueParameters) {
|
||||
transformValueParameter(valueParameter, data)
|
||||
@@ -296,9 +292,6 @@ abstract class AbstractFirStatusResolveTransformer(
|
||||
}
|
||||
declaration.compose()
|
||||
}
|
||||
is FirPropertyAccessor -> {
|
||||
declaration.compose()
|
||||
}
|
||||
else -> {
|
||||
transformElement(declaration, data)
|
||||
}
|
||||
@@ -433,13 +426,16 @@ abstract class AbstractFirStatusResolveTransformer(
|
||||
statusComputationSession.endComputing(regularClass)
|
||||
}
|
||||
|
||||
override fun transformPropertyAccessor(
|
||||
private fun transformPropertyAccessor(
|
||||
propertyAccessor: FirPropertyAccessor,
|
||||
data: FirResolvedDeclarationStatus?
|
||||
): CompositeTransformResult<FirDeclaration> {
|
||||
propertyAccessor.transformStatus(this, statusResolver.resolveStatus(propertyAccessor, containingClass, isLocal = false))
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
return transformDeclaration(propertyAccessor, data)
|
||||
containingProperty: FirProperty,
|
||||
) {
|
||||
propertyAccessor.transformStatus(
|
||||
this,
|
||||
statusResolver.resolveStatus(propertyAccessor, containingClass, containingProperty, isLocal = false)
|
||||
)
|
||||
|
||||
propertyAccessor.replaceResolvePhase(transformerPhase)
|
||||
}
|
||||
|
||||
override fun transformConstructor(
|
||||
@@ -465,7 +461,11 @@ abstract class AbstractFirStatusResolveTransformer(
|
||||
): CompositeTransformResult<FirDeclaration> {
|
||||
property.replaceResolvePhase(transformerPhase)
|
||||
property.transformStatus(this, statusResolver.resolveStatus(property, containingClass, isLocal = false))
|
||||
return transformDeclaration(property, data)
|
||||
|
||||
property.getter?.let { transformPropertyAccessor(it, property) }
|
||||
property.setter?.let { transformPropertyAccessor(it, property) }
|
||||
|
||||
return property.compose()
|
||||
}
|
||||
|
||||
override fun transformField(
|
||||
|
||||
+25
-13
@@ -17,7 +17,6 @@ import org.jetbrains.kotlin.fir.render
|
||||
import org.jetbrains.kotlin.fir.resolve.ScopeSession
|
||||
import org.jetbrains.kotlin.fir.scopes.ProcessorAction
|
||||
import org.jetbrains.kotlin.fir.scopes.unsubstitutedScope
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirNamedFunctionSymbol
|
||||
|
||||
class FirStatusResolver(
|
||||
val session: FirSession,
|
||||
@@ -36,11 +35,16 @@ class FirStatusResolver(
|
||||
FirDeclarationStatusImpl.Modifier.values().toList() - NOT_INHERITED_MODIFIERS
|
||||
}
|
||||
|
||||
fun resolveStatus(declaration: FirDeclaration, containingClass: FirClass<*>?, isLocal: Boolean): FirResolvedDeclarationStatus {
|
||||
fun resolveStatus(
|
||||
declaration: FirDeclaration,
|
||||
containingClass: FirClass<*>?,
|
||||
containingProperty: FirProperty?,
|
||||
isLocal: Boolean
|
||||
): FirResolvedDeclarationStatus {
|
||||
return when (declaration) {
|
||||
is FirProperty -> resolveStatus(declaration, containingClass, isLocal)
|
||||
is FirSimpleFunction -> resolveStatus(declaration, containingClass, isLocal)
|
||||
is FirPropertyAccessor -> resolveStatus(declaration, containingClass, isLocal)
|
||||
is FirPropertyAccessor -> resolveStatus(declaration, containingClass, containingProperty, isLocal)
|
||||
is FirRegularClass -> resolveStatus(declaration, containingClass, isLocal)
|
||||
is FirTypeAlias -> resolveStatus(declaration, containingClass, isLocal)
|
||||
is FirConstructor -> resolveStatus(declaration, containingClass, isLocal)
|
||||
@@ -51,7 +55,7 @@ class FirStatusResolver(
|
||||
|
||||
@OptIn(ExperimentalStdlibApi::class)
|
||||
fun resolveStatus(property: FirProperty, containingClass: FirClass<*>?, isLocal: Boolean): FirResolvedDeclarationStatus {
|
||||
return resolveStatus(property, property.status, containingClass, isLocal) l@{
|
||||
return resolveStatus(property, property.status, containingClass, null, isLocal) l@{
|
||||
if (containingClass == null) return@l emptyList()
|
||||
@Suppress("RemoveExplicitTypeArguments") // Workaround for KT-42175
|
||||
buildList<FirProperty> {
|
||||
@@ -69,7 +73,7 @@ class FirStatusResolver(
|
||||
|
||||
@OptIn(ExperimentalStdlibApi::class)
|
||||
fun resolveStatus(function: FirSimpleFunction, containingClass: FirClass<*>?, isLocal: Boolean): FirResolvedDeclarationStatus {
|
||||
return resolveStatus(function, function.status, containingClass, isLocal) l@{
|
||||
return resolveStatus(function, function.status, containingClass, null, isLocal) l@{
|
||||
if (containingClass == null) return@l emptyList()
|
||||
@Suppress("RemoveExplicitTypeArguments") // Workaround for KT-42175
|
||||
buildList<FirCallableMemberDeclaration<*>> {
|
||||
@@ -91,7 +95,7 @@ class FirStatusResolver(
|
||||
containingClass: FirClass<*>?,
|
||||
isLocal: Boolean
|
||||
): FirResolvedDeclarationStatus {
|
||||
return resolveStatus(regularClass, regularClass.status, containingClass, isLocal) { emptyList() }
|
||||
return resolveStatus(regularClass, regularClass.status, containingClass, null, isLocal) { emptyList() }
|
||||
}
|
||||
|
||||
fun resolveStatus(
|
||||
@@ -99,33 +103,35 @@ class FirStatusResolver(
|
||||
containingClass: FirClass<*>?,
|
||||
isLocal: Boolean
|
||||
): FirResolvedDeclarationStatus {
|
||||
return resolveStatus(typeAlias, typeAlias.status, containingClass, isLocal) { emptyList() }
|
||||
return resolveStatus(typeAlias, typeAlias.status, containingClass, null, isLocal) { emptyList() }
|
||||
}
|
||||
|
||||
fun resolveStatus(
|
||||
propertyAccessor: FirPropertyAccessor,
|
||||
containingClass: FirClass<*>?,
|
||||
containingProperty: FirProperty?,
|
||||
isLocal: Boolean
|
||||
): FirResolvedDeclarationStatus {
|
||||
return resolveStatus(propertyAccessor, propertyAccessor.status, containingClass, isLocal) { emptyList() }
|
||||
return resolveStatus(propertyAccessor, propertyAccessor.status, containingClass, containingProperty, isLocal) { emptyList() }
|
||||
}
|
||||
|
||||
fun resolveStatus(constructor: FirConstructor, containingClass: FirClass<*>?, isLocal: Boolean): FirResolvedDeclarationStatus {
|
||||
return resolveStatus(constructor, constructor.status, containingClass, isLocal) { emptyList() }
|
||||
return resolveStatus(constructor, constructor.status, containingClass, null, isLocal) { emptyList() }
|
||||
}
|
||||
|
||||
fun resolveStatus(field: FirField, containingClass: FirClass<*>?, isLocal: Boolean): FirResolvedDeclarationStatus {
|
||||
return resolveStatus(field, field.status, containingClass, isLocal) { emptyList() }
|
||||
return resolveStatus(field, field.status, containingClass, null, isLocal) { emptyList() }
|
||||
}
|
||||
|
||||
fun resolveStatus(enumEntry: FirEnumEntry, containingClass: FirClass<*>?, isLocal: Boolean): FirResolvedDeclarationStatus {
|
||||
return resolveStatus(enumEntry, enumEntry.status, containingClass, isLocal) { emptyList() }
|
||||
return resolveStatus(enumEntry, enumEntry.status, containingClass, null, isLocal) { emptyList() }
|
||||
}
|
||||
|
||||
private inline fun resolveStatus(
|
||||
declaration: FirDeclaration,
|
||||
status: FirDeclarationStatus,
|
||||
containingClass: FirClass<*>?,
|
||||
containingProperty: FirProperty?,
|
||||
isLocal: Boolean,
|
||||
overriddenExtractor: () -> List<FirResolvedDeclarationStatus>
|
||||
): FirResolvedDeclarationStatus {
|
||||
@@ -137,7 +143,7 @@ class FirStatusResolver(
|
||||
val visibility = when (status.visibility) {
|
||||
Visibilities.Unknown -> when {
|
||||
isLocal -> Visibilities.Local
|
||||
else -> resolveVisibility(declaration, containingClass, overriddenStatuses)
|
||||
else -> resolveVisibility(declaration, containingClass, containingProperty, overriddenStatuses)
|
||||
}
|
||||
else -> status.visibility
|
||||
}
|
||||
@@ -162,14 +168,20 @@ class FirStatusResolver(
|
||||
private fun resolveVisibility(
|
||||
declaration: FirDeclaration,
|
||||
containingClass: FirClass<*>?,
|
||||
containingProperty: FirProperty?,
|
||||
overriddenStatuses: List<FirResolvedDeclarationStatusImpl>
|
||||
): Visibility {
|
||||
if (declaration is FirConstructor && containingClass?.hasPrivateConstructor() == true) return Visibilities.Private
|
||||
|
||||
val fallbackVisibility = when {
|
||||
declaration is FirPropertyAccessor && containingProperty != null -> containingProperty.visibility
|
||||
else -> Visibilities.Public
|
||||
}
|
||||
|
||||
return overriddenStatuses.map { it.visibility }
|
||||
.maxWithOrNull { v1, v2 -> Visibilities.compare(v1, v2) ?: -1 }
|
||||
?.normalize()
|
||||
?: Visibilities.Public
|
||||
?: fallbackVisibility
|
||||
}
|
||||
|
||||
private fun FirClass<*>.hasPrivateConstructor(): Boolean {
|
||||
|
||||
+7
-3
@@ -126,8 +126,8 @@ open class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransfor
|
||||
if (property.isLocal) {
|
||||
prepareSignatureForBodyResolve(property)
|
||||
property.transformStatus(this, property.resolveStatus().mode())
|
||||
property.getter?.let { it.transformStatus(this, it.resolveStatus().mode()) }
|
||||
property.setter?.let { it.transformStatus(this, it.resolveStatus().mode()) }
|
||||
property.getter?.let { it.transformStatus(this, it.resolveStatus(containingProperty = property).mode()) }
|
||||
property.setter?.let { it.transformStatus(this, it.resolveStatus(containingProperty = property).mode()) }
|
||||
return transformLocalVariable(property)
|
||||
}
|
||||
|
||||
@@ -380,11 +380,15 @@ open class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransfor
|
||||
}
|
||||
}
|
||||
|
||||
private fun FirDeclaration.resolveStatus(containingClass: FirClass<*>? = null): FirDeclarationStatus {
|
||||
private fun FirDeclaration.resolveStatus(
|
||||
containingClass: FirClass<*>? = null,
|
||||
containingProperty: FirProperty? = null,
|
||||
): FirDeclarationStatus {
|
||||
val containingDeclaration = context.containerIfAny
|
||||
return statusResolver.resolveStatus(
|
||||
this,
|
||||
containingClass as? FirRegularClass,
|
||||
containingProperty,
|
||||
isLocal = containingDeclaration != null && containingClass == null
|
||||
)
|
||||
}
|
||||
|
||||
+18
@@ -2060,6 +2060,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement
|
||||
runTest("jps-plugin/testData/incremental/withJava/other/multifileClassRemoved/");
|
||||
}
|
||||
|
||||
@TestMetadata("multifileDependantUsage")
|
||||
public void testMultifileDependantUsage() throws Exception {
|
||||
runTest("jps-plugin/testData/incremental/withJava/other/multifileDependantUsage/");
|
||||
}
|
||||
|
||||
@TestMetadata("multifilePackagePartMethodAdded")
|
||||
public void testMultifilePackagePartMethodAdded() throws Exception {
|
||||
runTest("jps-plugin/testData/incremental/withJava/other/multifilePackagePartMethodAdded/");
|
||||
@@ -2378,6 +2383,19 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("jps-plugin/testData/incremental/withJava/other/multifileDependantUsage")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class MultifileDependantUsage extends AbstractIncrementalJvmCompilerRunnerTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInMultifileDependantUsage() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileDependantUsage"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("jps-plugin/testData/incremental/withJava/other/multifilePackagePartMethodAdded")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
+18
@@ -2060,6 +2060,11 @@ public class IncrementalJvmOldBackendCompilerRunnerTestGenerated extends Abstrac
|
||||
runTest("jps-plugin/testData/incremental/withJava/other/multifileClassRemoved/");
|
||||
}
|
||||
|
||||
@TestMetadata("multifileDependantUsage")
|
||||
public void testMultifileDependantUsage() throws Exception {
|
||||
runTest("jps-plugin/testData/incremental/withJava/other/multifileDependantUsage/");
|
||||
}
|
||||
|
||||
@TestMetadata("multifilePackagePartMethodAdded")
|
||||
public void testMultifilePackagePartMethodAdded() throws Exception {
|
||||
runTest("jps-plugin/testData/incremental/withJava/other/multifilePackagePartMethodAdded/");
|
||||
@@ -2378,6 +2383,19 @@ public class IncrementalJvmOldBackendCompilerRunnerTestGenerated extends Abstrac
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("jps-plugin/testData/incremental/withJava/other/multifileDependantUsage")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class MultifileDependantUsage extends AbstractIncrementalJvmOldBackendCompilerRunnerTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInMultifileDependantUsage() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileDependantUsage"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("jps-plugin/testData/incremental/withJava/other/multifilePackagePartMethodAdded")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// WITH_RUNTIME
|
||||
|
||||
open class A {
|
||||
private val _myVal by lazy {
|
||||
"1" + "2"
|
||||
}
|
||||
}
|
||||
|
||||
class B : A() {
|
||||
private val _myVal by lazy {
|
||||
"O" + "K"
|
||||
}
|
||||
|
||||
fun res() = _myVal
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return B().res()
|
||||
}
|
||||
@@ -107,7 +107,7 @@ val <T : Any?> Value<T, CR<T>>.additionalText: P<T, T> /* by */
|
||||
|
||||
<no name provided>()
|
||||
}
|
||||
get(): T {
|
||||
private get(): T {
|
||||
return <this> /*as <no name provided> */.#deepO$delegate.getValue(t = <this>, p = <no name provided>::deepO)
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ val <T : Any?> Value<T, CR<T>>.additionalText: P<T, T> /* by */
|
||||
|
||||
<no name provided>()
|
||||
}
|
||||
get(): T {
|
||||
private get(): T {
|
||||
return <this> /*as <no name provided> */.#deepK$delegate.getValue(t = <this>, p = <no name provided>::deepK)
|
||||
}
|
||||
|
||||
|
||||
@@ -271,18 +271,18 @@ FILE fqName:<root> fileName:/genericDelegatedDeepProperty.kt
|
||||
public open fun toString (): kotlin.String [fake_override] declared in <root>.IDelegate1
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.additionalText$delegate.<no name provided>.deepO$delegate.<no name provided>' type=<root>.additionalText$delegate.<no name provided>.deepO$delegate.<no name provided><T of <root>.<get-additionalText>> origin=OBJECT_LITERAL
|
||||
FUN DELEGATED_PROPERTY_ACCESSOR name:<get-deepO> visibility:public modality:FINAL <> ($this:<root>.additionalText$delegate.<no name provided><T of <root>.<get-additionalText>>, $receiver:<root>.Value<T of <root>.<get-additionalText>, <root>.CR<T of <root>.<get-additionalText>>>) returnType:T of <root>.<get-additionalText>
|
||||
FUN DELEGATED_PROPERTY_ACCESSOR name:<get-deepO> visibility:private modality:FINAL <> ($this:<root>.additionalText$delegate.<no name provided><T of <root>.<get-additionalText>>, $receiver:<root>.Value<T of <root>.<get-additionalText>, <root>.CR<T of <root>.<get-additionalText>>>) returnType:T of <root>.<get-additionalText>
|
||||
correspondingProperty: PROPERTY name:deepO visibility:private modality:FINAL [delegated,val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.additionalText$delegate.<no name provided><T of <root>.<get-additionalText>>
|
||||
$receiver: VALUE_PARAMETER name:<this> type:<root>.Value<T of <root>.<get-additionalText>, <root>.CR<T of <root>.<get-additionalText>>>
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-deepO> (): T of <root>.<get-additionalText> declared in <root>.additionalText$delegate.<no name provided>'
|
||||
RETURN type=kotlin.Nothing from='private final fun <get-deepO> (): T of <root>.<get-additionalText> declared in <root>.additionalText$delegate.<no name provided>'
|
||||
CALL 'public final fun getValue (t: <root>.Value<T of <root>.<get-additionalText>, <root>.CR<T of <root>.<get-additionalText>>>, p: kotlin.reflect.KProperty<*>): T of <root>.<get-additionalText> [operator] declared in <root>.additionalText$delegate.<no name provided>.deepO$delegate.<no name provided>' type=T of <root>.<get-additionalText> origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:deepO$delegate type:<root>.additionalText$delegate.<no name provided>.deepO$delegate.<no name provided><T of <root>.<get-additionalText>> visibility:private [final]' type=<root>.additionalText$delegate.<no name provided>.deepO$delegate.<no name provided><T of <root>.<get-additionalText>> origin=null
|
||||
receiver: TYPE_OP type=<root>.additionalText$delegate.<no name provided> origin=IMPLICIT_CAST typeOperand=<root>.additionalText$delegate.<no name provided>
|
||||
GET_VAR '<this>: <root>.additionalText$delegate.<no name provided><T of <root>.<get-additionalText>> declared in <root>.additionalText$delegate.<no name provided>.<get-deepO>' type=<root>.additionalText$delegate.<no name provided><T of <root>.<get-additionalText>> origin=null
|
||||
t: GET_VAR '<this>: <root>.Value<T of <root>.<get-additionalText>, <root>.CR<T of <root>.<get-additionalText>>> declared in <root>.additionalText$delegate.<no name provided>.<get-deepO>' type=<root>.Value<T of <root>.<get-additionalText>, <root>.CR<T of <root>.<get-additionalText>>> origin=null
|
||||
p: PROPERTY_REFERENCE 'private final deepO: T of <root>.<get-additionalText> [delegated,val]' field=null getter='public final fun <get-deepO> (): T of <root>.<get-additionalText> declared in <root>.additionalText$delegate.<no name provided>' setter=null type=kotlin.reflect.KProperty2<<root>.Value<T of <root>.<get-additionalText>, <root>.CR<T of <root>.<get-additionalText>>>, *, T of <root>.<get-additionalText>> origin=PROPERTY_REFERENCE_FOR_DELEGATE
|
||||
p: PROPERTY_REFERENCE 'private final deepO: T of <root>.<get-additionalText> [delegated,val]' field=null getter='private final fun <get-deepO> (): T of <root>.<get-additionalText> declared in <root>.additionalText$delegate.<no name provided>' setter=null type=kotlin.reflect.KProperty2<<root>.Value<T of <root>.<get-additionalText>, <root>.CR<T of <root>.<get-additionalText>>>, *, T of <root>.<get-additionalText>> origin=PROPERTY_REFERENCE_FOR_DELEGATE
|
||||
PROPERTY name:deepK visibility:private modality:FINAL [delegated,val]
|
||||
FIELD PROPERTY_DELEGATE name:deepK$delegate type:<root>.additionalText$delegate.<no name provided>.deepK$delegate.<no name provided><T of <root>.<get-additionalText>> visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
@@ -318,18 +318,18 @@ FILE fqName:<root> fileName:/genericDelegatedDeepProperty.kt
|
||||
public open fun toString (): kotlin.String [fake_override] declared in <root>.IDelegate1
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.additionalText$delegate.<no name provided>.deepK$delegate.<no name provided>' type=<root>.additionalText$delegate.<no name provided>.deepK$delegate.<no name provided><T of <root>.<get-additionalText>> origin=OBJECT_LITERAL
|
||||
FUN DELEGATED_PROPERTY_ACCESSOR name:<get-deepK> visibility:public modality:FINAL <> ($this:<root>.additionalText$delegate.<no name provided><T of <root>.<get-additionalText>>, $receiver:<root>.Value<T of <root>.<get-additionalText>, <root>.CR<T of <root>.<get-additionalText>>>) returnType:T of <root>.<get-additionalText>
|
||||
FUN DELEGATED_PROPERTY_ACCESSOR name:<get-deepK> visibility:private modality:FINAL <> ($this:<root>.additionalText$delegate.<no name provided><T of <root>.<get-additionalText>>, $receiver:<root>.Value<T of <root>.<get-additionalText>, <root>.CR<T of <root>.<get-additionalText>>>) returnType:T of <root>.<get-additionalText>
|
||||
correspondingProperty: PROPERTY name:deepK visibility:private modality:FINAL [delegated,val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.additionalText$delegate.<no name provided><T of <root>.<get-additionalText>>
|
||||
$receiver: VALUE_PARAMETER name:<this> type:<root>.Value<T of <root>.<get-additionalText>, <root>.CR<T of <root>.<get-additionalText>>>
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-deepK> (): T of <root>.<get-additionalText> declared in <root>.additionalText$delegate.<no name provided>'
|
||||
RETURN type=kotlin.Nothing from='private final fun <get-deepK> (): T of <root>.<get-additionalText> declared in <root>.additionalText$delegate.<no name provided>'
|
||||
CALL 'public final fun getValue (t: <root>.Value<T of <root>.<get-additionalText>, <root>.CR<T of <root>.<get-additionalText>>>, p: kotlin.reflect.KProperty<*>): T of <root>.<get-additionalText> [operator] declared in <root>.additionalText$delegate.<no name provided>.deepK$delegate.<no name provided>' type=T of <root>.<get-additionalText> origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:deepK$delegate type:<root>.additionalText$delegate.<no name provided>.deepK$delegate.<no name provided><T of <root>.<get-additionalText>> visibility:private [final]' type=<root>.additionalText$delegate.<no name provided>.deepK$delegate.<no name provided><T of <root>.<get-additionalText>> origin=null
|
||||
receiver: TYPE_OP type=<root>.additionalText$delegate.<no name provided> origin=IMPLICIT_CAST typeOperand=<root>.additionalText$delegate.<no name provided>
|
||||
GET_VAR '<this>: <root>.additionalText$delegate.<no name provided><T of <root>.<get-additionalText>> declared in <root>.additionalText$delegate.<no name provided>.<get-deepK>' type=<root>.additionalText$delegate.<no name provided><T of <root>.<get-additionalText>> origin=null
|
||||
t: GET_VAR '<this>: <root>.Value<T of <root>.<get-additionalText>, <root>.CR<T of <root>.<get-additionalText>>> declared in <root>.additionalText$delegate.<no name provided>.<get-deepK>' type=<root>.Value<T of <root>.<get-additionalText>, <root>.CR<T of <root>.<get-additionalText>>> origin=null
|
||||
p: PROPERTY_REFERENCE 'private final deepK: T of <root>.<get-additionalText> [delegated,val]' field=null getter='public final fun <get-deepK> (): T of <root>.<get-additionalText> declared in <root>.additionalText$delegate.<no name provided>' setter=null type=kotlin.reflect.KProperty2<<root>.Value<T of <root>.<get-additionalText>, <root>.CR<T of <root>.<get-additionalText>>>, *, T of <root>.<get-additionalText>> origin=PROPERTY_REFERENCE_FOR_DELEGATE
|
||||
p: PROPERTY_REFERENCE 'private final deepK: T of <root>.<get-additionalText> [delegated,val]' field=null getter='private final fun <get-deepK> (): T of <root>.<get-additionalText> declared in <root>.additionalText$delegate.<no name provided>' setter=null type=kotlin.reflect.KProperty2<<root>.Value<T of <root>.<get-additionalText>, <root>.CR<T of <root>.<get-additionalText>>>, *, T of <root>.<get-additionalText>> origin=PROPERTY_REFERENCE_FOR_DELEGATE
|
||||
FUN name:getValue visibility:public modality:FINAL <> ($this:<root>.additionalText$delegate.<no name provided><T of <root>.<get-additionalText>>, t:<root>.Value<T of <root>.<get-additionalText>, <root>.CR<T of <root>.<get-additionalText>>>, p:kotlin.reflect.KProperty<*>) returnType:<root>.P<T of <root>.<get-additionalText>, T of <root>.<get-additionalText>> [operator]
|
||||
overridden:
|
||||
public abstract fun getValue (t: T1 of <root>.IDelegate1, p: kotlin.reflect.KProperty<*>): R1 of <root>.IDelegate1 [operator] declared in <root>.IDelegate1
|
||||
@@ -341,10 +341,10 @@ FILE fqName:<root> fileName:/genericDelegatedDeepProperty.kt
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (p1: P1 of <root>.P, p2: P2 of <root>.P) [primary] declared in <root>.P' type=<root>.P<T of <root>.<get-additionalText>, T of <root>.<get-additionalText>> origin=null
|
||||
<class: P1>: T of <root>.<get-additionalText>
|
||||
<class: P2>: T of <root>.<get-additionalText>
|
||||
p1: CALL 'public final fun <get-deepO> (): T of <root>.<get-additionalText> declared in <root>.additionalText$delegate.<no name provided>' type=T of <root>.<get-additionalText> origin=GET_PROPERTY
|
||||
p1: CALL 'private final fun <get-deepO> (): T of <root>.<get-additionalText> declared in <root>.additionalText$delegate.<no name provided>' type=T of <root>.<get-additionalText> origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.additionalText$delegate.<no name provided><T of <root>.<get-additionalText>> declared in <root>.additionalText$delegate.<no name provided>.getValue' type=<root>.additionalText$delegate.<no name provided><T of <root>.<get-additionalText>> origin=null
|
||||
$receiver: GET_VAR 't: <root>.Value<T of <root>.<get-additionalText>, <root>.CR<T of <root>.<get-additionalText>>> declared in <root>.additionalText$delegate.<no name provided>.getValue' type=<root>.Value<T of <root>.<get-additionalText>, <root>.CR<T of <root>.<get-additionalText>>> origin=null
|
||||
p2: CALL 'public final fun <get-deepK> (): T of <root>.<get-additionalText> declared in <root>.additionalText$delegate.<no name provided>' type=T of <root>.<get-additionalText> origin=GET_PROPERTY
|
||||
p2: CALL 'private final fun <get-deepK> (): T of <root>.<get-additionalText> declared in <root>.additionalText$delegate.<no name provided>' type=T of <root>.<get-additionalText> origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.additionalText$delegate.<no name provided><T of <root>.<get-additionalText>> declared in <root>.additionalText$delegate.<no name provided>.getValue' type=<root>.additionalText$delegate.<no name provided><T of <root>.<get-additionalText>> origin=null
|
||||
$receiver: GET_VAR 't: <root>.Value<T of <root>.<get-additionalText>, <root>.CR<T of <root>.<get-additionalText>>> declared in <root>.additionalText$delegate.<no name provided>.getValue' type=<root>.Value<T of <root>.<get-additionalText>, <root>.CR<T of <root>.<get-additionalText>>> origin=null
|
||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
|
||||
|
||||
+6
@@ -12674,6 +12674,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/kt9712.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("privateInSubClass.kt")
|
||||
public void testPrivateInSubClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/privateInSubClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("privateSetterKPropertyIsNotMutable.kt")
|
||||
public void testPrivateSetterKPropertyIsNotMutable() throws Exception {
|
||||
|
||||
+6
@@ -12674,6 +12674,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/kt9712.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("privateInSubClass.kt")
|
||||
public void testPrivateInSubClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/privateInSubClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("privateSetterKPropertyIsNotMutable.kt")
|
||||
public void testPrivateSetterKPropertyIsNotMutable() throws Exception {
|
||||
|
||||
+5
@@ -10351,6 +10351,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/kt9712.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("privateInSubClass.kt")
|
||||
public void testPrivateInSubClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/privateInSubClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("privateSetterKPropertyIsNotMutable.kt")
|
||||
public void testPrivateSetterKPropertyIsNotMutable() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/privateSetterKPropertyIsNotMutable.kt");
|
||||
|
||||
Generated
+18
-5
@@ -2251,6 +2251,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes
|
||||
runTest("jps-plugin/testData/incremental/withJava/other/multifileClassRemoved/");
|
||||
}
|
||||
|
||||
@TestMetadata("multifileDependantUsage")
|
||||
public void testMultifileDependantUsage() throws Exception {
|
||||
runTest("jps-plugin/testData/incremental/withJava/other/multifileDependantUsage/");
|
||||
}
|
||||
|
||||
@TestMetadata("multifilePackagePartMethodAdded")
|
||||
public void testMultifilePackagePartMethodAdded() throws Exception {
|
||||
runTest("jps-plugin/testData/incremental/withJava/other/multifilePackagePartMethodAdded/");
|
||||
@@ -2261,11 +2266,6 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes
|
||||
runTest("jps-plugin/testData/incremental/withJava/other/multifilePartsWithProperties/");
|
||||
}
|
||||
|
||||
@TestMetadata("multifileDependantUsage")
|
||||
public void testMultifileDependantUsage() throws Exception {
|
||||
runTest("jps-plugin/testData/incremental/withJava/other/multifileDependantUsage/");
|
||||
}
|
||||
|
||||
@TestMetadata("optionalParameter")
|
||||
public void testOptionalParameter() throws Exception {
|
||||
runTest("jps-plugin/testData/incremental/withJava/other/optionalParameter/");
|
||||
@@ -2574,6 +2574,19 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("jps-plugin/testData/incremental/withJava/other/multifileDependantUsage")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class MultifileDependantUsage extends AbstractIncrementalJvmJpsTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInMultifileDependantUsage() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileDependantUsage"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("jps-plugin/testData/incremental/withJava/other/multifilePackagePartMethodAdded")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
Reference in New Issue
Block a user