diff --git a/compiler/fir/providers/src/org/jetbrains/kotlin/fir/resolve/calls/Synthetics.kt b/compiler/fir/providers/src/org/jetbrains/kotlin/fir/resolve/calls/Synthetics.kt index 28aae1566fe..c00722cb68a 100644 --- a/compiler/fir/providers/src/org/jetbrains/kotlin/fir/resolve/calls/Synthetics.kt +++ b/compiler/fir/providers/src/org/jetbrains/kotlin/fir/resolve/calls/Synthetics.kt @@ -115,6 +115,10 @@ class FirSyntheticPropertiesScope private constructor( if (getter.valueParameters.isNotEmpty()) return if (getter.isStatic) return + // Should have Java among overridden _and_ don't have isHiddenEverywhereBesideSuperCalls among them + val (getterCompatibility, deprecatedOverrideOfHidden) = getterSymbol.computeGetterCompatibility() + if (getterCompatibility == Incompatible) return + var getterReturnType = (getter.returnTypeRef as? FirResolvedTypeRef)?.type if (getterReturnType == null && needCheckForSetter) { // During implicit body resolve phase, we can encounter a reference to a not yet resolved Kotlin class that inherits a @@ -126,10 +130,6 @@ class FirSyntheticPropertiesScope private constructor( // And it doesn't make sense to make a synthetic property for `void` typed getters if (getterReturnType?.isUnit == true && CompilerConeAttributes.EnhancedNullability !in getterReturnType.attributes) return - // Should have Java among overridden _and_ don't have isHiddenEverywhereBesideSuperCalls among them - val (getterCompatibility, deprecatedOverrideOfHidden) = getterSymbol.computeGetterCompatibility() - if (getterCompatibility == Incompatible) return - var matchingSetter: FirSimpleFunction? = null if (needCheckForSetter && getterReturnType != null) { val setterName = syntheticNamesProvider.setterNameByGetterName(getterName) diff --git a/compiler/testData/diagnostics/tests/resolve/complexOrderAndImplicitTypes.fir.kt b/compiler/testData/diagnostics/tests/resolve/complexOrderAndImplicitTypes.fir.kt deleted file mode 100644 index 8fd5b72431d..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/complexOrderAndImplicitTypes.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// ISSUE: KT-66313 - -val foo: String get() = "" - -class Test1 { - private val otherFoo = foo - - fun getFoo() = otherFoo -} - -class Test2 { - fun getFoo() = otherFoo - - private val otherFoo = foo -} diff --git a/compiler/testData/diagnostics/tests/resolve/complexOrderAndImplicitTypes.kt b/compiler/testData/diagnostics/tests/resolve/complexOrderAndImplicitTypes.kt index 80b5a1a3924..c185acb9736 100644 --- a/compiler/testData/diagnostics/tests/resolve/complexOrderAndImplicitTypes.kt +++ b/compiler/testData/diagnostics/tests/resolve/complexOrderAndImplicitTypes.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // ISSUE: KT-66313 val foo: String get() = ""