[FIR] fix resolve contract violation from scopes
We cannot call lazy resolve to STATUS phase from scopes as scopes may be accessed on a STATUS phase or earlier ^KT-54890 ^KTIJ-23587 fixed
This commit is contained in:
+5
-2
@@ -43,8 +43,8 @@ import org.jetbrains.kotlin.fir.scopes.FirContainingNamesAwareScope
|
|||||||
import org.jetbrains.kotlin.fir.scopes.FirScope
|
import org.jetbrains.kotlin.fir.scopes.FirScope
|
||||||
import org.jetbrains.kotlin.fir.scopes.impl.*
|
import org.jetbrains.kotlin.fir.scopes.impl.*
|
||||||
import org.jetbrains.kotlin.fir.scopes.unsubstitutedScope
|
import org.jetbrains.kotlin.fir.scopes.unsubstitutedScope
|
||||||
import org.jetbrains.kotlin.fir.symbols.lazyResolveToPhase
|
|
||||||
import org.jetbrains.kotlin.fir.symbols.impl.*
|
import org.jetbrains.kotlin.fir.symbols.impl.*
|
||||||
|
import org.jetbrains.kotlin.fir.symbols.lazyResolveToPhase
|
||||||
import org.jetbrains.kotlin.name.FqName
|
import org.jetbrains.kotlin.name.FqName
|
||||||
import org.jetbrains.kotlin.name.Name
|
import org.jetbrains.kotlin.name.Name
|
||||||
import org.jetbrains.kotlin.psi.KtElement
|
import org.jetbrains.kotlin.psi.KtElement
|
||||||
@@ -85,6 +85,7 @@ internal class KtFirScopeProvider(
|
|||||||
override fun getMemberScope(classSymbol: KtSymbolWithMembers): KtScope {
|
override fun getMemberScope(classSymbol: KtSymbolWithMembers): KtScope {
|
||||||
return memberScopeCache.getOrPut(classSymbol) {
|
return memberScopeCache.getOrPut(classSymbol) {
|
||||||
val firScope = classSymbol.withFirForScope { fir ->
|
val firScope = classSymbol.withFirForScope { fir ->
|
||||||
|
fir.lazyResolveToPhase(FirResolvePhase.STATUS)
|
||||||
val firSession = analysisSession.useSiteSession
|
val firSession = analysisSession.useSiteSession
|
||||||
fir.unsubstitutedScope(
|
fir.unsubstitutedScope(
|
||||||
firSession,
|
firSession,
|
||||||
@@ -124,6 +125,7 @@ internal class KtFirScopeProvider(
|
|||||||
?: return delegatedMemberScopeCache.getOrPut(classSymbol) { getEmptyScope() }
|
?: return delegatedMemberScopeCache.getOrPut(classSymbol) { getEmptyScope() }
|
||||||
return delegatedMemberScopeCache.getOrPut(classSymbol) {
|
return delegatedMemberScopeCache.getOrPut(classSymbol) {
|
||||||
val firScope = classSymbol.withFirForScope { fir ->
|
val firScope = classSymbol.withFirForScope { fir ->
|
||||||
|
fir.lazyResolveToPhase(FirResolvePhase.STATUS)
|
||||||
val delegateFields = fir.delegateFields
|
val delegateFields = fir.delegateFields
|
||||||
if (delegateFields.isNotEmpty()) {
|
if (delegateFields.isNotEmpty()) {
|
||||||
val firSession = analysisSession.useSiteSession
|
val firSession = analysisSession.useSiteSession
|
||||||
@@ -170,7 +172,8 @@ internal class KtFirScopeProvider(
|
|||||||
val firTypeScope = type.coneType.scope(
|
val firTypeScope = type.coneType.scope(
|
||||||
firSession,
|
firSession,
|
||||||
scopeSession,
|
scopeSession,
|
||||||
FakeOverrideTypeCalculator.Forced
|
FakeOverrideTypeCalculator.Forced,
|
||||||
|
requiredPhase = FirResolvePhase.STATUS,
|
||||||
) ?: return null
|
) ?: return null
|
||||||
return KtCompositeTypeScope(
|
return KtCompositeTypeScope(
|
||||||
listOfNotNull(
|
listOfNotNull(
|
||||||
|
|||||||
+3
-1
@@ -25,6 +25,7 @@ import org.jetbrains.kotlin.analysis.api.types.KtType
|
|||||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.api.LLFirResolveSession
|
import org.jetbrains.kotlin.analysis.low.level.api.fir.api.LLFirResolveSession
|
||||||
import org.jetbrains.kotlin.descriptors.Modality
|
import org.jetbrains.kotlin.descriptors.Modality
|
||||||
import org.jetbrains.kotlin.descriptors.Visibility
|
import org.jetbrains.kotlin.descriptors.Visibility
|
||||||
|
import org.jetbrains.kotlin.fir.declarations.FirResolvePhase
|
||||||
import org.jetbrains.kotlin.fir.declarations.impl.FirDefaultPropertyAccessor
|
import org.jetbrains.kotlin.fir.declarations.impl.FirDefaultPropertyAccessor
|
||||||
import org.jetbrains.kotlin.fir.declarations.synthetic.FirSyntheticPropertyAccessor
|
import org.jetbrains.kotlin.fir.declarations.synthetic.FirSyntheticPropertyAccessor
|
||||||
import org.jetbrains.kotlin.fir.declarations.utils.*
|
import org.jetbrains.kotlin.fir.declarations.utils.*
|
||||||
@@ -58,7 +59,8 @@ internal class KtFirPropertySetterSymbol(
|
|||||||
val containingClassScope = firSymbol.dispatchReceiverType?.scope(
|
val containingClassScope = firSymbol.dispatchReceiverType?.scope(
|
||||||
session,
|
session,
|
||||||
firResolveSession.getScopeSessionFor(session),
|
firResolveSession.getScopeSessionFor(session),
|
||||||
FakeOverrideTypeCalculator.DoNothing
|
FakeOverrideTypeCalculator.DoNothing,
|
||||||
|
requiredPhase = FirResolvePhase.STATUS,
|
||||||
) ?: return false
|
) ?: return false
|
||||||
val overriddenProperties = containingClassScope.getDirectOverriddenProperties(propertySymbol)
|
val overriddenProperties = containingClassScope.getDirectOverriddenProperties(propertySymbol)
|
||||||
overriddenProperties.any { it.isVar }
|
overriddenProperties.any { it.isVar }
|
||||||
|
|||||||
+3
@@ -14,9 +14,11 @@ import org.jetbrains.kotlin.analysis.api.symbols.pointers.KtSymbolPointer
|
|||||||
import org.jetbrains.kotlin.analysis.utils.errors.requireIsInstance
|
import org.jetbrains.kotlin.analysis.utils.errors.requireIsInstance
|
||||||
import org.jetbrains.kotlin.fir.FirSession
|
import org.jetbrains.kotlin.fir.FirSession
|
||||||
import org.jetbrains.kotlin.fir.declarations.FirClass
|
import org.jetbrains.kotlin.fir.declarations.FirClass
|
||||||
|
import org.jetbrains.kotlin.fir.declarations.FirResolvePhase
|
||||||
import org.jetbrains.kotlin.fir.scopes.FirScope
|
import org.jetbrains.kotlin.fir.scopes.FirScope
|
||||||
import org.jetbrains.kotlin.fir.scopes.unsubstitutedScope
|
import org.jetbrains.kotlin.fir.scopes.unsubstitutedScope
|
||||||
import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol
|
import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol
|
||||||
|
import org.jetbrains.kotlin.fir.symbols.lazyResolveToPhase
|
||||||
|
|
||||||
internal abstract class KtFirMemberSymbolPointer<S : KtSymbol>(
|
internal abstract class KtFirMemberSymbolPointer<S : KtSymbol>(
|
||||||
private val ownerPointer: KtSymbolPointer<KtSymbolWithMembers>,
|
private val ownerPointer: KtSymbolPointer<KtSymbolWithMembers>,
|
||||||
@@ -28,6 +30,7 @@ internal abstract class KtFirMemberSymbolPointer<S : KtSymbol>(
|
|||||||
val scope = with(analysisSession) {
|
val scope = with(analysisSession) {
|
||||||
val ownerSymbol = ownerPointer.restoreSymbol() ?: return null
|
val ownerSymbol = ownerPointer.restoreSymbol() ?: return null
|
||||||
val owner = ownerSymbol.firSymbol as? FirClassSymbol ?: return null
|
val owner = ownerSymbol.firSymbol as? FirClassSymbol ?: return null
|
||||||
|
owner.lazyResolveToPhase(FirResolvePhase.STATUS)
|
||||||
getSearchScope(owner)
|
getSearchScope(owner)
|
||||||
} ?: return null
|
} ?: return null
|
||||||
|
|
||||||
|
|||||||
Vendored
+1
-1
@@ -157,7 +157,7 @@ FILE: anonymousObjectInInvalidPosition.kt
|
|||||||
|
|
||||||
private [BODY_RESOLVE] get(): <ERROR TYPE REF: Wrong number of type arguments>
|
private [BODY_RESOLVE] get(): <ERROR TYPE REF: Wrong number of type arguments>
|
||||||
public abstract [TYPES] interface A<[TYPES] T> : R|kotlin/Any| {
|
public abstract [TYPES] interface A<[TYPES] T> : R|kotlin/Any| {
|
||||||
public abstract [STATUS] fun x(): R|kotlin/Unit|
|
public abstract [TYPES] fun x(): R|kotlin/Unit|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
interface A<D : A<D>> {
|
interface A<D : A<D>> {
|
||||||
fun foo(): Any
|
fun foo(): Any
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
interface A {
|
interface A {
|
||||||
fun foo()
|
fun foo()
|
||||||
}
|
}
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
open class A
|
open class A
|
||||||
|
|
||||||
interface B : <!DELEGATION_IN_INTERFACE, DELEGATION_NOT_TO_INTERFACE, INTERFACE_WITH_SUPERCLASS!>A<!> by <!UNRESOLVED_REFERENCE!>a<!> {
|
interface B : <!DELEGATION_IN_INTERFACE, DELEGATION_NOT_TO_INTERFACE, INTERFACE_WITH_SUPERCLASS!>A<!> by <!UNRESOLVED_REFERENCE!>a<!> {
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
open class A {
|
open class A {
|
||||||
open var test: Number = 10
|
open var test: Number = 10
|
||||||
}
|
}
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !LANGUAGE: -QualifiedSupertypeMayBeExtendedByOtherSupertype
|
// !LANGUAGE: -QualifiedSupertypeMayBeExtendedByOtherSupertype
|
||||||
interface IBase<T> {
|
interface IBase<T> {
|
||||||
fun foo() {}
|
fun foo() {}
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
open class A {
|
open class A {
|
||||||
open fun test(): Number = 10
|
open fun test(): Number = 10
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
open class A
|
open class A
|
||||||
open class B : A()
|
open class B : A()
|
||||||
|
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
interface A {
|
interface A {
|
||||||
fun foo()
|
fun foo()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// FILE: LookupElement.java
|
// FILE: LookupElement.java
|
||||||
|
|
||||||
public abstract class LookupElement {
|
public abstract class LookupElement {
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
abstract class Base<T>(val x: T) {
|
abstract class Base<T>(val x: T) {
|
||||||
abstract fun foo(): T
|
abstract fun foo(): T
|
||||||
}
|
}
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
open class Protected {
|
open class Protected {
|
||||||
protected fun bar() {}
|
protected fun bar() {}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
interface List<out T : Any> {
|
interface List<out T : Any> {
|
||||||
operator fun get(index: Int): T
|
operator fun get(index: Int): T
|
||||||
|
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// WITH_EXTENDED_CHECKERS
|
// WITH_EXTENDED_CHECKERS
|
||||||
class A {
|
class A {
|
||||||
<!VALUE_CLASS_NOT_TOP_LEVEL!>inline<!> inner class B(val x: Int)
|
<!VALUE_CLASS_NOT_TOP_LEVEL!>inline<!> inner class B(val x: Int)
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// ISSUE: KT-41984
|
// ISSUE: KT-41984
|
||||||
|
|
||||||
// FILE: A.java
|
// FILE: A.java
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !CHECK_TYPE
|
// !CHECK_TYPE
|
||||||
// ISSUE: KT-37070
|
// ISSUE: KT-37070
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !CHECK_TYPE
|
// !CHECK_TYPE
|
||||||
// UNEXPECTED BEHAVIOUR
|
// UNEXPECTED BEHAVIOUR
|
||||||
// ISSUES: KT-37066
|
// ISSUES: KT-37066
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
interface CommonBackendContext
|
interface CommonBackendContext
|
||||||
|
|
||||||
interface PhaserState<Data> {
|
interface PhaserState<Data> {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
interface Left
|
interface Left
|
||||||
interface Right
|
interface Right
|
||||||
class Bottom : Left, Right
|
class Bottom : Left, Right
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
interface FirElement {
|
interface FirElement {
|
||||||
fun <R, D> accept(visitor: FirVisitor<R, D>, data: D): R
|
fun <R, D> accept(visitor: FirVisitor<R, D>, data: D): R
|
||||||
|
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// FILE: JA.java
|
// FILE: JA.java
|
||||||
public interface JA<E> {
|
public interface JA<E> {
|
||||||
public E getFoo();
|
public E getFoo();
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// SCOPE_DUMP: C:getName;setName;name, D:getName;setName;name
|
// SCOPE_DUMP: C:getName;setName;name, D:getName;setName;name
|
||||||
// FILE: A.java
|
// FILE: A.java
|
||||||
public interface A {
|
public interface A {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// WITH_EXTENDED_CHECKERS
|
// WITH_EXTENDED_CHECKERS
|
||||||
|
|
||||||
import <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>kotlin.jvm.functions.Function0<!>
|
import <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>kotlin.jvm.functions.Function0<!>
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// FULL_JDK
|
// FULL_JDK
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import java.util.function.BiConsumer
|
import java.util.function.BiConsumer
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
enum class Some {
|
enum class Some {
|
||||||
ENTRY {
|
ENTRY {
|
||||||
override fun toString(): String = "Entry"
|
override fun toString(): String = "Entry"
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// MODULE: m1
|
// MODULE: m1
|
||||||
// FILE: m1.kt
|
// FILE: m1.kt
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
import java.util.AbstractSet
|
import java.util.AbstractSet
|
||||||
|
|
||||||
class SmartSet<T> : AbstractSet<T>() {
|
class SmartSet<T> : AbstractSet<T>() {
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !LANGUAGE: +MultiPlatformProjects
|
// !LANGUAGE: +MultiPlatformProjects
|
||||||
// MODULE: m1-common
|
// MODULE: m1-common
|
||||||
// FILE: common.kt
|
// FILE: common.kt
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// FILE: AbstractToolConfig.kt
|
// FILE: AbstractToolConfig.kt
|
||||||
|
|
||||||
abstract class AbstractToolConfig {
|
abstract class AbstractToolConfig {
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
import kotlin.reflect.KProperty
|
import kotlin.reflect.KProperty
|
||||||
import kotlin.properties.ReadOnlyProperty
|
import kotlin.properties.ReadOnlyProperty
|
||||||
|
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
interface PsiMember
|
interface PsiMember
|
||||||
|
|
||||||
interface PsiField : PsiMember
|
interface PsiField : PsiMember
|
||||||
|
|||||||
+5
-2
@@ -12,13 +12,16 @@ import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext
|
|||||||
import org.jetbrains.kotlin.fir.analysis.checkers.expression.FirCallableReferenceAccessChecker
|
import org.jetbrains.kotlin.fir.analysis.checkers.expression.FirCallableReferenceAccessChecker
|
||||||
import org.jetbrains.kotlin.fir.analysis.diagnostics.jvm.FirJvmErrors
|
import org.jetbrains.kotlin.fir.analysis.diagnostics.jvm.FirJvmErrors
|
||||||
import org.jetbrains.kotlin.fir.containingClassLookupTag
|
import org.jetbrains.kotlin.fir.containingClassLookupTag
|
||||||
|
import org.jetbrains.kotlin.fir.declarations.FirResolvePhase
|
||||||
import org.jetbrains.kotlin.fir.declarations.utils.hasBackingField
|
import org.jetbrains.kotlin.fir.declarations.utils.hasBackingField
|
||||||
import org.jetbrains.kotlin.fir.declarations.utils.visibility
|
import org.jetbrains.kotlin.fir.declarations.utils.visibility
|
||||||
import org.jetbrains.kotlin.fir.expressions.FirCallableReferenceAccess
|
import org.jetbrains.kotlin.fir.expressions.FirCallableReferenceAccess
|
||||||
import org.jetbrains.kotlin.fir.expressions.impl.FirNoReceiverExpression
|
import org.jetbrains.kotlin.fir.expressions.impl.FirNoReceiverExpression
|
||||||
import org.jetbrains.kotlin.fir.packageFqName
|
import org.jetbrains.kotlin.fir.packageFqName
|
||||||
import org.jetbrains.kotlin.fir.references.FirResolvedNamedReference
|
import org.jetbrains.kotlin.fir.references.FirResolvedNamedReference
|
||||||
import org.jetbrains.kotlin.fir.resolve.*
|
import org.jetbrains.kotlin.fir.resolve.isSubclassOf
|
||||||
|
import org.jetbrains.kotlin.fir.resolve.scope
|
||||||
|
import org.jetbrains.kotlin.fir.resolve.toFirRegularClassSymbol
|
||||||
import org.jetbrains.kotlin.fir.scopes.FakeOverrideTypeCalculator
|
import org.jetbrains.kotlin.fir.scopes.FakeOverrideTypeCalculator
|
||||||
import org.jetbrains.kotlin.fir.symbols.impl.FirFieldSymbol
|
import org.jetbrains.kotlin.fir.symbols.impl.FirFieldSymbol
|
||||||
import org.jetbrains.kotlin.fir.symbols.impl.FirPropertySymbol
|
import org.jetbrains.kotlin.fir.symbols.impl.FirPropertySymbol
|
||||||
@@ -39,7 +42,7 @@ object FirJavaShadowedFieldReferenceChecker : FirCallableReferenceAccessChecker(
|
|||||||
|
|
||||||
val dispatchReceiver = expression.dispatchReceiver.takeIf { it !is FirNoReceiverExpression } ?: return
|
val dispatchReceiver = expression.dispatchReceiver.takeIf { it !is FirNoReceiverExpression } ?: return
|
||||||
val scope = dispatchReceiver.typeRef.coneType.scope(
|
val scope = dispatchReceiver.typeRef.coneType.scope(
|
||||||
session, context.sessionHolder.scopeSession, FakeOverrideTypeCalculator.DoNothing
|
session, context.sessionHolder.scopeSession, FakeOverrideTypeCalculator.DoNothing, requiredPhase = FirResolvePhase.TYPES
|
||||||
) ?: return
|
) ?: return
|
||||||
|
|
||||||
var shadowingPropertyClassId: ClassId? = null
|
var shadowingPropertyClassId: ClassId? = null
|
||||||
|
|||||||
+2
-1
@@ -207,7 +207,8 @@ abstract class AbstractAnnotationDeserializer(
|
|||||||
val firAnnotationClass = (symbol as? FirRegularClassSymbol)?.fir ?: return@lazy null
|
val firAnnotationClass = (symbol as? FirRegularClassSymbol)?.fir ?: return@lazy null
|
||||||
|
|
||||||
val classScope =
|
val classScope =
|
||||||
firAnnotationClass.defaultType().scope(session, ScopeSession(), FakeOverrideTypeCalculator.DoNothing)
|
firAnnotationClass.defaultType()
|
||||||
|
.scope(session, ScopeSession(), FakeOverrideTypeCalculator.DoNothing, requiredPhase = null)
|
||||||
?: error("Null scope for $classId")
|
?: error("Null scope for $classId")
|
||||||
|
|
||||||
val constructor =
|
val constructor =
|
||||||
|
|||||||
+2
-2
@@ -151,7 +151,7 @@ class FirElementSerializer private constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun FirClass.nestedClassifiers(): List<FirClassifierSymbol<*>> {
|
fun FirClass.nestedClassifiers(): List<FirClassifierSymbol<*>> {
|
||||||
val scope = defaultType().scope(session, scopeSession, FakeOverrideTypeCalculator.DoNothing) ?: return emptyList()
|
val scope = defaultType().scope(session, scopeSession, FakeOverrideTypeCalculator.DoNothing, requiredPhase = null) ?: return emptyList()
|
||||||
return buildList {
|
return buildList {
|
||||||
scope.getClassifierNames().mapNotNullTo(this) { scope.getSingleClassifier(it) }
|
scope.getClassifierNames().mapNotNullTo(this) { scope.getSingleClassifier(it) }
|
||||||
}
|
}
|
||||||
@@ -226,7 +226,7 @@ class FirElementSerializer private constructor(
|
|||||||
|
|
||||||
private fun FirClass.declarations(): List<FirCallableDeclaration> = buildList {
|
private fun FirClass.declarations(): List<FirCallableDeclaration> = buildList {
|
||||||
val memberScope =
|
val memberScope =
|
||||||
defaultType().scope(session, scopeSession, FakeOverrideTypeCalculator.DoNothing)
|
defaultType().scope(session, scopeSession, FakeOverrideTypeCalculator.DoNothing, requiredPhase = null)
|
||||||
?: error("Null scope for $this")
|
?: error("Null scope for $this")
|
||||||
|
|
||||||
fun addDeclarationIfNeeded(symbol: FirCallableSymbol<*>) {
|
fun addDeclarationIfNeeded(symbol: FirCallableSymbol<*>) {
|
||||||
|
|||||||
@@ -28,14 +28,21 @@ import org.jetbrains.kotlin.name.ClassId
|
|||||||
|
|
||||||
fun FirSmartCastExpression.smartcastScope(
|
fun FirSmartCastExpression.smartcastScope(
|
||||||
useSiteSession: FirSession,
|
useSiteSession: FirSession,
|
||||||
scopeSession: ScopeSession
|
scopeSession: ScopeSession,
|
||||||
|
requiredPhase: FirResolvePhase? = null,
|
||||||
): FirTypeScope? {
|
): FirTypeScope? {
|
||||||
val smartcastType = smartcastTypeWithoutNullableNothing?.coneType ?: smartcastType.coneType
|
val smartcastType = smartcastTypeWithoutNullableNothing?.coneType ?: smartcastType.coneType
|
||||||
val smartcastScope = smartcastType.scope(useSiteSession, scopeSession, FakeOverrideTypeCalculator.DoNothing)
|
val smartcastScope = smartcastType.scope(
|
||||||
|
useSiteSession,
|
||||||
|
scopeSession,
|
||||||
|
FakeOverrideTypeCalculator.DoNothing,
|
||||||
|
requiredPhase = FirResolvePhase.STATUS
|
||||||
|
)
|
||||||
if (isStable) {
|
if (isStable) {
|
||||||
return smartcastScope
|
return smartcastScope
|
||||||
}
|
}
|
||||||
val originalScope = originalExpression.typeRef.coneType.scope(useSiteSession, scopeSession, FakeOverrideTypeCalculator.DoNothing)
|
val originalScope = originalExpression.typeRef.coneType
|
||||||
|
.scope(useSiteSession, scopeSession, FakeOverrideTypeCalculator.DoNothing, requiredPhase)
|
||||||
?: return smartcastScope
|
?: return smartcastScope
|
||||||
|
|
||||||
if (smartcastScope == null) {
|
if (smartcastScope == null) {
|
||||||
@@ -55,14 +62,15 @@ fun ConeClassLikeType.delegatingConstructorScope(
|
|||||||
fun ConeKotlinType.scope(
|
fun ConeKotlinType.scope(
|
||||||
useSiteSession: FirSession,
|
useSiteSession: FirSession,
|
||||||
scopeSession: ScopeSession,
|
scopeSession: ScopeSession,
|
||||||
fakeOverrideTypeCalculator: FakeOverrideTypeCalculator
|
fakeOverrideTypeCalculator: FakeOverrideTypeCalculator,
|
||||||
|
requiredPhase: FirResolvePhase?,
|
||||||
): FirTypeScope? {
|
): FirTypeScope? {
|
||||||
val scope = scope(useSiteSession, scopeSession, FirResolvePhase.DECLARATIONS) ?: return null
|
val scope = scope(useSiteSession, scopeSession, requiredPhase) ?: return null
|
||||||
if (fakeOverrideTypeCalculator == FakeOverrideTypeCalculator.DoNothing) return scope
|
if (fakeOverrideTypeCalculator == FakeOverrideTypeCalculator.DoNothing) return scope
|
||||||
return FirScopeWithFakeOverrideTypeCalculator(scope, fakeOverrideTypeCalculator)
|
return FirScopeWithFakeOverrideTypeCalculator(scope, fakeOverrideTypeCalculator)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun ConeKotlinType.scope(useSiteSession: FirSession, scopeSession: ScopeSession, requiredPhase: FirResolvePhase): FirTypeScope? {
|
private fun ConeKotlinType.scope(useSiteSession: FirSession, scopeSession: ScopeSession, requiredPhase: FirResolvePhase?): FirTypeScope? {
|
||||||
return when (this) {
|
return when (this) {
|
||||||
is ConeErrorType -> null
|
is ConeErrorType -> null
|
||||||
is ConeClassLikeType -> classScope(useSiteSession, scopeSession, requiredPhase, lookupTag)
|
is ConeClassLikeType -> classScope(useSiteSession, scopeSession, requiredPhase, lookupTag)
|
||||||
@@ -99,13 +107,15 @@ private fun ConeKotlinType.scope(useSiteSession: FirSession, scopeSession: Scope
|
|||||||
private fun ConeClassLikeType.classScope(
|
private fun ConeClassLikeType.classScope(
|
||||||
useSiteSession: FirSession,
|
useSiteSession: FirSession,
|
||||||
scopeSession: ScopeSession,
|
scopeSession: ScopeSession,
|
||||||
requiredPhase: FirResolvePhase,
|
requiredPhase: FirResolvePhase?,
|
||||||
memberOwnerLookupTag: ConeClassLikeLookupTag
|
memberOwnerLookupTag: ConeClassLikeLookupTag
|
||||||
): FirTypeScope? {
|
): FirTypeScope? {
|
||||||
val fullyExpandedType = fullyExpandedType(useSiteSession)
|
val fullyExpandedType = fullyExpandedType(useSiteSession)
|
||||||
val fir = fullyExpandedType.lookupTag.toSymbol(useSiteSession)?.fir as? FirClass ?: return null
|
val fir = fullyExpandedType.lookupTag.toSymbol(useSiteSession)?.fir as? FirClass ?: return null
|
||||||
|
|
||||||
fir.symbol.lazyResolveToPhase(requiredPhase)
|
if (requiredPhase != null) {
|
||||||
|
fir.symbol.lazyResolveToPhase(requiredPhase)
|
||||||
|
}
|
||||||
|
|
||||||
val substitutor = when {
|
val substitutor = when {
|
||||||
attributes.contains(CompilerConeAttributes.RawType) -> ConeRawScopeSubstitutor(useSiteSession)
|
attributes.contains(CompilerConeAttributes.RawType) -> ConeRawScopeSubstitutor(useSiteSession)
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import org.jetbrains.kotlin.KtFakeSourceElementKind
|
|||||||
import org.jetbrains.kotlin.fakeElement
|
import org.jetbrains.kotlin.fakeElement
|
||||||
import org.jetbrains.kotlin.fir.FirSession
|
import org.jetbrains.kotlin.fir.FirSession
|
||||||
import org.jetbrains.kotlin.fir.copyWithNewSourceKind
|
import org.jetbrains.kotlin.fir.copyWithNewSourceKind
|
||||||
|
import org.jetbrains.kotlin.fir.declarations.FirResolvePhase
|
||||||
import org.jetbrains.kotlin.fir.diagnostics.ConeIntermediateDiagnostic
|
import org.jetbrains.kotlin.fir.diagnostics.ConeIntermediateDiagnostic
|
||||||
import org.jetbrains.kotlin.fir.expressions.*
|
import org.jetbrains.kotlin.fir.expressions.*
|
||||||
import org.jetbrains.kotlin.fir.expressions.builder.buildSmartCastExpression
|
import org.jetbrains.kotlin.fir.expressions.builder.buildSmartCastExpression
|
||||||
@@ -41,7 +42,7 @@ interface ReceiverValue : Receiver {
|
|||||||
val receiverExpression: FirExpression
|
val receiverExpression: FirExpression
|
||||||
|
|
||||||
fun scope(useSiteSession: FirSession, scopeSession: ScopeSession): FirTypeScope? =
|
fun scope(useSiteSession: FirSession, scopeSession: ScopeSession): FirTypeScope? =
|
||||||
type.scope(useSiteSession, scopeSession, FakeOverrideTypeCalculator.DoNothing)
|
type.scope(useSiteSession, scopeSession, FakeOverrideTypeCalculator.DoNothing, requiredPhase = FirResolvePhase.STATUS)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: should inherit just Receiver, not ReceiverValue
|
// TODO: should inherit just Receiver, not ReceiverValue
|
||||||
@@ -70,9 +71,9 @@ open class ExpressionReceiverValue(
|
|||||||
receiverExpr = receiverExpr.arguments.firstOrNull()
|
receiverExpr = receiverExpr.arguments.firstOrNull()
|
||||||
}
|
}
|
||||||
if (receiverExpr is FirSmartCastExpression) {
|
if (receiverExpr is FirSmartCastExpression) {
|
||||||
return receiverExpr.smartcastScope(useSiteSession, scopeSession)
|
return receiverExpr.smartcastScope(useSiteSession, scopeSession, requiredPhase = FirResolvePhase.STATUS)
|
||||||
}
|
}
|
||||||
return type.scope(useSiteSession, scopeSession, FakeOverrideTypeCalculator.DoNothing)
|
return type.scope(useSiteSession, scopeSession, FakeOverrideTypeCalculator.DoNothing, requiredPhase = FirResolvePhase.STATUS)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,7 +92,8 @@ sealed class ImplicitReceiverValue<S : FirBasedSymbol<*>>(
|
|||||||
|
|
||||||
val originalType: ConeKotlinType = type
|
val originalType: ConeKotlinType = type
|
||||||
|
|
||||||
var implicitScope: FirTypeScope? = type.scope(useSiteSession, scopeSession, FakeOverrideTypeCalculator.DoNothing)
|
var implicitScope: FirTypeScope? =
|
||||||
|
type.scope(useSiteSession, scopeSession, FakeOverrideTypeCalculator.DoNothing, requiredPhase = FirResolvePhase.STATUS)
|
||||||
private set
|
private set
|
||||||
|
|
||||||
override fun scope(useSiteSession: FirSession, scopeSession: ScopeSession): FirTypeScope? = implicitScope
|
override fun scope(useSiteSession: FirSession, scopeSession: ScopeSession): FirTypeScope? = implicitScope
|
||||||
@@ -132,7 +134,8 @@ sealed class ImplicitReceiverValue<S : FirBasedSymbol<*>>(
|
|||||||
typeRef = smartcastType.copyWithNewSourceKind(KtFakeSourceElementKind.ImplicitTypeRef)
|
typeRef = smartcastType.copyWithNewSourceKind(KtFakeSourceElementKind.ImplicitTypeRef)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
implicitScope = type.scope(useSiteSession, scopeSession, FakeOverrideTypeCalculator.DoNothing)
|
implicitScope =
|
||||||
|
type.scope(useSiteSession, scopeSession, FakeOverrideTypeCalculator.DoNothing, requiredPhase = FirResolvePhase.STATUS)
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract fun createSnapshot(): ImplicitReceiverValue<S>
|
abstract fun createSnapshot(): ImplicitReceiverValue<S>
|
||||||
|
|||||||
@@ -8,16 +8,14 @@ package org.jetbrains.kotlin.fir.scopes
|
|||||||
import org.jetbrains.annotations.TestOnly
|
import org.jetbrains.annotations.TestOnly
|
||||||
import org.jetbrains.kotlin.fir.FirSession
|
import org.jetbrains.kotlin.fir.FirSession
|
||||||
import org.jetbrains.kotlin.fir.declarations.FirRegularClass
|
import org.jetbrains.kotlin.fir.declarations.FirRegularClass
|
||||||
|
import org.jetbrains.kotlin.fir.declarations.FirResolvePhase
|
||||||
import org.jetbrains.kotlin.fir.resolve.ScopeSession
|
import org.jetbrains.kotlin.fir.resolve.ScopeSession
|
||||||
import org.jetbrains.kotlin.fir.resolve.providers.symbolProvider
|
|
||||||
import org.jetbrains.kotlin.fir.resolve.scope
|
import org.jetbrains.kotlin.fir.resolve.scope
|
||||||
import org.jetbrains.kotlin.fir.resolve.toSymbol
|
import org.jetbrains.kotlin.fir.resolve.toSymbol
|
||||||
import org.jetbrains.kotlin.fir.symbols.ConeClassLikeLookupTag
|
import org.jetbrains.kotlin.fir.symbols.ConeClassLikeLookupTag
|
||||||
import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol
|
import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol
|
||||||
import org.jetbrains.kotlin.fir.symbols.impl.FirNamedFunctionSymbol
|
import org.jetbrains.kotlin.fir.symbols.impl.FirNamedFunctionSymbol
|
||||||
import org.jetbrains.kotlin.fir.symbols.impl.FirPropertySymbol
|
import org.jetbrains.kotlin.fir.symbols.impl.FirPropertySymbol
|
||||||
import org.jetbrains.kotlin.fir.types.classId
|
|
||||||
import org.jetbrains.kotlin.name.ClassId
|
|
||||||
|
|
||||||
fun ConeClassLikeLookupTag.getNestedClassifierScope(session: FirSession, scopeSession: ScopeSession): FirContainingNamesAwareScope? {
|
fun ConeClassLikeLookupTag.getNestedClassifierScope(session: FirSession, scopeSession: ScopeSession): FirContainingNamesAwareScope? {
|
||||||
val klass = toSymbol(session)?.fir as? FirRegularClass ?: return null
|
val klass = toSymbol(session)?.fir as? FirRegularClass ?: return null
|
||||||
@@ -29,7 +27,12 @@ fun ConeClassLikeLookupTag.getNestedClassifierScope(session: FirSession, scopeSe
|
|||||||
*/
|
*/
|
||||||
@TestOnly
|
@TestOnly
|
||||||
fun debugCollectOverrides(symbol: FirCallableSymbol<*>, session: FirSession, scopeSession: ScopeSession): Map<Any, Any> {
|
fun debugCollectOverrides(symbol: FirCallableSymbol<*>, session: FirSession, scopeSession: ScopeSession): Map<Any, Any> {
|
||||||
val scope = symbol.dispatchReceiverType?.scope(session, scopeSession, FakeOverrideTypeCalculator.DoNothing) ?: return emptyMap()
|
val scope = symbol.dispatchReceiverType?.scope(
|
||||||
|
session,
|
||||||
|
scopeSession,
|
||||||
|
FakeOverrideTypeCalculator.DoNothing,
|
||||||
|
requiredPhase = FirResolvePhase.STATUS
|
||||||
|
) ?: return emptyMap()
|
||||||
return debugCollectOverrides(symbol, scope)
|
return debugCollectOverrides(symbol, scope)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-4
@@ -116,6 +116,7 @@ class FirClassSubstitutionScope(
|
|||||||
|
|
||||||
fun createSubstitutionOverrideFunction(original: FirNamedFunctionSymbol): FirNamedFunctionSymbol {
|
fun createSubstitutionOverrideFunction(original: FirNamedFunctionSymbol): FirNamedFunctionSymbol {
|
||||||
if (substitutor == ConeSubstitutor.Empty) return original
|
if (substitutor == ConeSubstitutor.Empty) return original
|
||||||
|
original.lazyResolveToPhase(FirResolvePhase.TYPES)
|
||||||
val member = original.fir
|
val member = original.fir
|
||||||
if (skipPrivateMembers && member.visibility == Visibilities.Private) return original
|
if (skipPrivateMembers && member.visibility == Visibilities.Private) return original
|
||||||
|
|
||||||
@@ -175,6 +176,7 @@ class FirClassSubstitutionScope(
|
|||||||
|
|
||||||
fun createSubstitutionOverrideConstructor(original: FirConstructorSymbol): FirConstructorSymbol {
|
fun createSubstitutionOverrideConstructor(original: FirConstructorSymbol): FirConstructorSymbol {
|
||||||
if (substitutor == ConeSubstitutor.Empty) return original
|
if (substitutor == ConeSubstitutor.Empty) return original
|
||||||
|
original.lazyResolveToPhase(FirResolvePhase.TYPES)
|
||||||
val constructor = original.fir
|
val constructor = original.fir
|
||||||
|
|
||||||
val symbolForOverride = FirConstructorSymbol(original.callableId)
|
val symbolForOverride = FirConstructorSymbol(original.callableId)
|
||||||
@@ -221,6 +223,7 @@ class FirClassSubstitutionScope(
|
|||||||
|
|
||||||
fun createSubstitutionOverrideProperty(original: FirPropertySymbol): FirPropertySymbol {
|
fun createSubstitutionOverrideProperty(original: FirPropertySymbol): FirPropertySymbol {
|
||||||
if (substitutor == ConeSubstitutor.Empty) return original
|
if (substitutor == ConeSubstitutor.Empty) return original
|
||||||
|
original.lazyResolveToPhase(FirResolvePhase.TYPES)
|
||||||
val member = original.fir
|
val member = original.fir
|
||||||
if (skipPrivateMembers && member.visibility == Visibilities.Private) return original
|
if (skipPrivateMembers && member.visibility == Visibilities.Private) return original
|
||||||
|
|
||||||
@@ -279,7 +282,6 @@ class FirClassSubstitutionScope(
|
|||||||
)
|
)
|
||||||
|
|
||||||
private fun createSubstitutedData(member: FirCallableDeclaration, symbolForOverride: FirBasedSymbol<*>): SubstitutedData {
|
private fun createSubstitutedData(member: FirCallableDeclaration, symbolForOverride: FirBasedSymbol<*>): SubstitutedData {
|
||||||
member.lazyResolveToPhase(FirResolvePhase.TYPES)
|
|
||||||
val (newTypeParameters, substitutor) = FirFakeOverrideGenerator.createNewTypeParametersAndSubstitutor(
|
val (newTypeParameters, substitutor) = FirFakeOverrideGenerator.createNewTypeParametersAndSubstitutor(
|
||||||
session,
|
session,
|
||||||
member as FirTypeParameterRefsOwner,
|
member as FirTypeParameterRefsOwner,
|
||||||
@@ -293,7 +295,6 @@ class FirClassSubstitutionScope(
|
|||||||
|
|
||||||
val newDispatchReceiverType = dispatchReceiverTypeForSubstitutedMembers.substitute(substitutor)
|
val newDispatchReceiverType = dispatchReceiverTypeForSubstitutedMembers.substitute(substitutor)
|
||||||
|
|
||||||
member.lazyResolveToPhase(FirResolvePhase.STATUS)
|
|
||||||
val returnType = member.returnTypeRef.coneTypeSafe<ConeKotlinType>()
|
val returnType = member.returnTypeRef.coneTypeSafe<ConeKotlinType>()
|
||||||
val fakeOverrideSubstitution = runIf(returnType == null) { FakeOverrideSubstitution(substitutor, member.symbol) }
|
val fakeOverrideSubstitution = runIf(returnType == null) { FakeOverrideSubstitution(substitutor, member.symbol) }
|
||||||
val newReturnType = returnType?.substitute(substitutor)
|
val newReturnType = returnType?.substitute(substitutor)
|
||||||
@@ -309,10 +310,10 @@ class FirClassSubstitutionScope(
|
|||||||
|
|
||||||
fun createSubstitutionOverrideField(original: FirFieldSymbol): FirFieldSymbol {
|
fun createSubstitutionOverrideField(original: FirFieldSymbol): FirFieldSymbol {
|
||||||
if (substitutor == ConeSubstitutor.Empty) return original
|
if (substitutor == ConeSubstitutor.Empty) return original
|
||||||
|
original.lazyResolveToPhase(FirResolvePhase.TYPES)
|
||||||
val member = original.fir
|
val member = original.fir
|
||||||
if (skipPrivateMembers && member.visibility == Visibilities.Private) return original
|
if (skipPrivateMembers && member.visibility == Visibilities.Private) return original
|
||||||
|
|
||||||
member.symbol.lazyResolveToPhase(FirResolvePhase.STATUS)
|
|
||||||
val returnType = member.returnTypeRef.coneTypeSafe<ConeKotlinType>()
|
val returnType = member.returnTypeRef.coneTypeSafe<ConeKotlinType>()
|
||||||
// TODO: do we have fields with implicit type?
|
// TODO: do we have fields with implicit type?
|
||||||
val newReturnType = returnType?.substitute() ?: return original
|
val newReturnType = returnType?.substitute() ?: return original
|
||||||
@@ -322,10 +323,10 @@ class FirClassSubstitutionScope(
|
|||||||
|
|
||||||
fun createSubstitutionOverrideSyntheticProperty(original: FirSyntheticPropertySymbol): FirSyntheticPropertySymbol {
|
fun createSubstitutionOverrideSyntheticProperty(original: FirSyntheticPropertySymbol): FirSyntheticPropertySymbol {
|
||||||
if (substitutor == ConeSubstitutor.Empty) return original
|
if (substitutor == ConeSubstitutor.Empty) return original
|
||||||
|
original.lazyResolveToPhase(FirResolvePhase.TYPES)
|
||||||
val member = original.fir as FirSyntheticProperty
|
val member = original.fir as FirSyntheticProperty
|
||||||
if (skipPrivateMembers && member.visibility == Visibilities.Private) return original
|
if (skipPrivateMembers && member.visibility == Visibilities.Private) return original
|
||||||
|
|
||||||
member.symbol.lazyResolveToPhase(FirResolvePhase.STATUS)
|
|
||||||
val returnType = member.returnTypeRef.coneTypeSafe<ConeKotlinType>()
|
val returnType = member.returnTypeRef.coneTypeSafe<ConeKotlinType>()
|
||||||
val fakeOverrideSubstitution = runIf(returnType == null) { FakeOverrideSubstitution(substitutor, original) }
|
val fakeOverrideSubstitution = runIf(returnType == null) { FakeOverrideSubstitution(substitutor, original) }
|
||||||
val newReturnType = returnType?.substitute()
|
val newReturnType = returnType?.substitute()
|
||||||
|
|||||||
+2
-3
@@ -17,7 +17,6 @@ import org.jetbrains.kotlin.fir.resolve.scope
|
|||||||
import org.jetbrains.kotlin.fir.resolve.substitution.ConeSubstitutor
|
import org.jetbrains.kotlin.fir.resolve.substitution.ConeSubstitutor
|
||||||
import org.jetbrains.kotlin.fir.scopes.*
|
import org.jetbrains.kotlin.fir.scopes.*
|
||||||
import org.jetbrains.kotlin.fir.symbols.ConeClassLikeLookupTag
|
import org.jetbrains.kotlin.fir.symbols.ConeClassLikeLookupTag
|
||||||
import org.jetbrains.kotlin.fir.symbols.lazyResolveToPhase
|
|
||||||
import org.jetbrains.kotlin.fir.symbols.impl.*
|
import org.jetbrains.kotlin.fir.symbols.impl.*
|
||||||
import org.jetbrains.kotlin.fir.types.ConeClassLikeType
|
import org.jetbrains.kotlin.fir.types.ConeClassLikeType
|
||||||
import org.jetbrains.kotlin.fir.types.ConeFlexibleType
|
import org.jetbrains.kotlin.fir.types.ConeFlexibleType
|
||||||
@@ -49,8 +48,8 @@ class FirDelegatedMemberScope(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun buildScope(delegateField: FirField): FirTypeScope? {
|
private fun buildScope(delegateField: FirField): FirTypeScope? {
|
||||||
delegateField.lazyResolveToPhase(FirResolvePhase.TYPES)
|
return delegateField.returnTypeRef.coneType
|
||||||
return delegateField.returnTypeRef.coneType.scope(session, scopeSession, FakeOverrideTypeCalculator.DoNothing)
|
.scope(session, scopeSession, FakeOverrideTypeCalculator.DoNothing, requiredPhase = null)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun collectFunctionsFromSpecificField(
|
private fun collectFunctionsFromSpecificField(
|
||||||
|
|||||||
@@ -18,7 +18,9 @@ import org.jetbrains.kotlin.fir.declarations.FirDeclarationOrigin
|
|||||||
import org.jetbrains.kotlin.fir.declarations.FirProperty
|
import org.jetbrains.kotlin.fir.declarations.FirProperty
|
||||||
import org.jetbrains.kotlin.fir.declarations.FirResolvePhase
|
import org.jetbrains.kotlin.fir.declarations.FirResolvePhase
|
||||||
import org.jetbrains.kotlin.fir.declarations.FirSimpleFunction
|
import org.jetbrains.kotlin.fir.declarations.FirSimpleFunction
|
||||||
import org.jetbrains.kotlin.fir.declarations.builder.*
|
import org.jetbrains.kotlin.fir.declarations.builder.buildProperty
|
||||||
|
import org.jetbrains.kotlin.fir.declarations.builder.buildSimpleFunction
|
||||||
|
import org.jetbrains.kotlin.fir.declarations.builder.buildValueParameter
|
||||||
import org.jetbrains.kotlin.fir.declarations.impl.FirResolvedDeclarationStatusImpl
|
import org.jetbrains.kotlin.fir.declarations.impl.FirResolvedDeclarationStatusImpl
|
||||||
import org.jetbrains.kotlin.fir.expressions.FirOperationNameConventions
|
import org.jetbrains.kotlin.fir.expressions.FirOperationNameConventions
|
||||||
import org.jetbrains.kotlin.fir.moduleData
|
import org.jetbrains.kotlin.fir.moduleData
|
||||||
@@ -59,7 +61,7 @@ class FirDynamicScope @FirDynamicScopeConstructor constructor(
|
|||||||
override fun getClassifierNames(): Set<Name> = emptySet()
|
override fun getClassifierNames(): Set<Name> = emptySet()
|
||||||
|
|
||||||
private val anyTypeScope by lazy {
|
private val anyTypeScope by lazy {
|
||||||
session.builtinTypes.anyType.type.scope(session, scopeSession, FakeOverrideTypeCalculator.DoNothing)
|
session.builtinTypes.anyType.type.scope(session, scopeSession, FakeOverrideTypeCalculator.DoNothing, requiredPhase = null)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun processFunctionsByName(
|
override fun processFunctionsByName(
|
||||||
|
|||||||
+2
-1
@@ -35,7 +35,8 @@ class FirIntegerConstantOperatorScope(
|
|||||||
true -> session.builtinTypes.uIntType
|
true -> session.builtinTypes.uIntType
|
||||||
false -> session.builtinTypes.intType
|
false -> session.builtinTypes.intType
|
||||||
}.type
|
}.type
|
||||||
baseType.scope(session, scopeSession, FakeOverrideTypeCalculator.DoNothing) ?: error("Scope for $baseType not found")
|
baseType.scope(session, scopeSession, FakeOverrideTypeCalculator.DoNothing, requiredPhase = null)
|
||||||
|
?: error("Scope for $baseType not found")
|
||||||
}
|
}
|
||||||
|
|
||||||
private val mappedFunctions = mutableMapOf<Name, FirNamedFunctionSymbol>()
|
private val mappedFunctions = mutableMapOf<Name, FirNamedFunctionSymbol>()
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ fun ConeKotlinType.findContributedInvokeSymbol(
|
|||||||
} else {
|
} else {
|
||||||
FakeOverrideTypeCalculator.DoNothing
|
FakeOverrideTypeCalculator.DoNothing
|
||||||
}
|
}
|
||||||
val scope = scope(session, scopeSession, fakeOverrideTypeCalculator) ?: return null
|
val scope = scope(session, scopeSession, fakeOverrideTypeCalculator, requiredPhase = null) ?: return null
|
||||||
var declaredInvoke: FirNamedFunctionSymbol? = null
|
var declaredInvoke: FirNamedFunctionSymbol? = null
|
||||||
scope.processFunctionsByName(OperatorNameConventions.INVOKE) { functionSymbol ->
|
scope.processFunctionsByName(OperatorNameConventions.INVOKE) { functionSymbol ->
|
||||||
if (functionSymbol.fir.valueParameters.size == baseInvokeSymbol.fir.valueParameters.size) {
|
if (functionSymbol.fir.valueParameters.size == baseInvokeSymbol.fir.valueParameters.size) {
|
||||||
|
|||||||
+6
-1
@@ -176,7 +176,12 @@ private fun processConstructors(
|
|||||||
is FirTypeAliasSymbol -> {
|
is FirTypeAliasSymbol -> {
|
||||||
matchedSymbol.lazyResolveToPhase(FirResolvePhase.TYPES)
|
matchedSymbol.lazyResolveToPhase(FirResolvePhase.TYPES)
|
||||||
val type = matchedSymbol.fir.expandedTypeRef.coneTypeUnsafe<ConeClassLikeType>().fullyExpandedType(session)
|
val type = matchedSymbol.fir.expandedTypeRef.coneTypeUnsafe<ConeClassLikeType>().fullyExpandedType(session)
|
||||||
val basicScope = type.scope(session, bodyResolveComponents.scopeSession, FakeOverrideTypeCalculator.DoNothing)
|
val basicScope = type.scope(
|
||||||
|
session,
|
||||||
|
bodyResolveComponents.scopeSession,
|
||||||
|
FakeOverrideTypeCalculator.DoNothing,
|
||||||
|
requiredPhase = FirResolvePhase.STATUS
|
||||||
|
)
|
||||||
|
|
||||||
val outerType = bodyResolveComponents.outerClassManager.outerType(type)
|
val outerType = bodyResolveComponents.outerClassManager.outerType(type)
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import org.jetbrains.kotlin.descriptors.ClassKind
|
|||||||
import org.jetbrains.kotlin.descriptors.Modality
|
import org.jetbrains.kotlin.descriptors.Modality
|
||||||
import org.jetbrains.kotlin.descriptors.isClass
|
import org.jetbrains.kotlin.descriptors.isClass
|
||||||
import org.jetbrains.kotlin.fir.declarations.FirCallableDeclaration
|
import org.jetbrains.kotlin.fir.declarations.FirCallableDeclaration
|
||||||
|
import org.jetbrains.kotlin.fir.declarations.FirResolvePhase
|
||||||
import org.jetbrains.kotlin.fir.declarations.FirVariable
|
import org.jetbrains.kotlin.fir.declarations.FirVariable
|
||||||
import org.jetbrains.kotlin.fir.declarations.utils.modality
|
import org.jetbrains.kotlin.fir.declarations.utils.modality
|
||||||
import org.jetbrains.kotlin.fir.dispatchReceiverClassLookupTagOrNull
|
import org.jetbrains.kotlin.fir.dispatchReceiverClassLookupTagOrNull
|
||||||
@@ -128,16 +129,14 @@ private inline fun BodyResolveComponents.resolveSupertypesByMembers(
|
|||||||
|
|
||||||
private fun BodyResolveComponents.getFunctionMembers(type: ConeKotlinType, name: Name): Collection<FirCallableDeclaration> =
|
private fun BodyResolveComponents.getFunctionMembers(type: ConeKotlinType, name: Name): Collection<FirCallableDeclaration> =
|
||||||
buildList {
|
buildList {
|
||||||
type.scope(session, scopeSession, FakeOverrideTypeCalculator.DoNothing)?.processFunctionsByName(name) {
|
type.scope(session, scopeSession, FakeOverrideTypeCalculator.DoNothing, requiredPhase = FirResolvePhase.STATUS)
|
||||||
add(it.fir)
|
?.processFunctionsByName(name) { add(it.fir) }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun BodyResolveComponents.getPropertyMembers(type: ConeKotlinType, name: Name): Collection<FirCallableDeclaration> =
|
private fun BodyResolveComponents.getPropertyMembers(type: ConeKotlinType, name: Name): Collection<FirCallableDeclaration> =
|
||||||
buildList {
|
buildList {
|
||||||
type.scope(session, scopeSession, FakeOverrideTypeCalculator.DoNothing)?.processPropertiesByName(name) {
|
type.scope(session, scopeSession, FakeOverrideTypeCalculator.DoNothing, requiredPhase = FirResolvePhase.STATUS)
|
||||||
addIfNotNull(it.fir as? FirVariable)
|
?.processPropertiesByName(name) { addIfNotNull(it.fir as? FirVariable) }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+13
-6
@@ -6,10 +6,7 @@
|
|||||||
package org.jetbrains.kotlin.fir.resolve.calls.tower
|
package org.jetbrains.kotlin.fir.resolve.calls.tower
|
||||||
|
|
||||||
import org.jetbrains.kotlin.fir.*
|
import org.jetbrains.kotlin.fir.*
|
||||||
import org.jetbrains.kotlin.fir.declarations.ContextReceiverGroup
|
import org.jetbrains.kotlin.fir.declarations.*
|
||||||
import org.jetbrains.kotlin.fir.declarations.FirCallableDeclaration
|
|
||||||
import org.jetbrains.kotlin.fir.declarations.FirConstructor
|
|
||||||
import org.jetbrains.kotlin.fir.declarations.getAnnotationByClassId
|
|
||||||
import org.jetbrains.kotlin.fir.declarations.utils.isInner
|
import org.jetbrains.kotlin.fir.declarations.utils.isInner
|
||||||
import org.jetbrains.kotlin.fir.declarations.utils.isStatic
|
import org.jetbrains.kotlin.fir.declarations.utils.isStatic
|
||||||
import org.jetbrains.kotlin.fir.expressions.FirExpression
|
import org.jetbrains.kotlin.fir.expressions.FirExpression
|
||||||
@@ -92,7 +89,12 @@ class MemberScopeTowerLevel(
|
|||||||
?.takeIf { it.isStable }
|
?.takeIf { it.isStable }
|
||||||
?.originalExpression?.typeRef
|
?.originalExpression?.typeRef
|
||||||
?.coneType
|
?.coneType
|
||||||
?.scope(session, scopeSession, bodyResolveComponents.returnTypeCalculator.fakeOverrideTypeCalculator)
|
?.scope(
|
||||||
|
session,
|
||||||
|
scopeSession,
|
||||||
|
bodyResolveComponents.returnTypeCalculator.fakeOverrideTypeCalculator,
|
||||||
|
requiredPhase = FirResolvePhase.STATUS
|
||||||
|
)
|
||||||
if (scopeWithoutSmartcast == null) {
|
if (scopeWithoutSmartcast == null) {
|
||||||
consumeCandidates(output, candidates)
|
consumeCandidates(output, candidates)
|
||||||
} else {
|
} else {
|
||||||
@@ -123,7 +125,12 @@ class MemberScopeTowerLevel(
|
|||||||
if (dispatchReceiverType.isRaw()) {
|
if (dispatchReceiverType.isRaw()) {
|
||||||
typeForSyntheticScope = dispatchReceiverType.convertToNonRawVersion()
|
typeForSyntheticScope = dispatchReceiverType.convertToNonRawVersion()
|
||||||
useSiteForSyntheticScope =
|
useSiteForSyntheticScope =
|
||||||
typeForSyntheticScope.scope(session, scopeSession, FakeOverrideTypeCalculator.DoNothing)
|
typeForSyntheticScope.scope(
|
||||||
|
session,
|
||||||
|
scopeSession,
|
||||||
|
FakeOverrideTypeCalculator.DoNothing,
|
||||||
|
requiredPhase = FirResolvePhase.STATUS
|
||||||
|
)
|
||||||
?: error("No scope for flexible type scope, while it's not null for $dispatchReceiverType")
|
?: error("No scope for flexible type scope, while it's not null for $dispatchReceiverType")
|
||||||
} else {
|
} else {
|
||||||
typeForSyntheticScope = dispatchReceiverType
|
typeForSyntheticScope = dispatchReceiverType
|
||||||
|
|||||||
+3
-1
@@ -9,6 +9,7 @@ import org.jetbrains.kotlin.KtFakeSourceElementKind
|
|||||||
import org.jetbrains.kotlin.fakeElement
|
import org.jetbrains.kotlin.fakeElement
|
||||||
import org.jetbrains.kotlin.fir.FirElement
|
import org.jetbrains.kotlin.fir.FirElement
|
||||||
import org.jetbrains.kotlin.fir.FirSession
|
import org.jetbrains.kotlin.fir.FirSession
|
||||||
|
import org.jetbrains.kotlin.fir.declarations.FirResolvePhase
|
||||||
import org.jetbrains.kotlin.fir.expressions.FirConstExpression
|
import org.jetbrains.kotlin.fir.expressions.FirConstExpression
|
||||||
import org.jetbrains.kotlin.fir.expressions.FirExpression
|
import org.jetbrains.kotlin.fir.expressions.FirExpression
|
||||||
import org.jetbrains.kotlin.fir.expressions.FirIntegerLiteralOperatorCall
|
import org.jetbrains.kotlin.fir.expressions.FirIntegerLiteralOperatorCall
|
||||||
@@ -50,7 +51,8 @@ class IntegerLiteralAndOperatorApproximationTransformer(
|
|||||||
private val toULongSymbol by lazy { findConversionFunction(session.builtinTypes.uIntType, TO_U_LONG)}
|
private val toULongSymbol by lazy { findConversionFunction(session.builtinTypes.uIntType, TO_U_LONG)}
|
||||||
|
|
||||||
private fun findConversionFunction(receiverType: FirImplicitBuiltinTypeRef, name: Name): FirNamedFunctionSymbol {
|
private fun findConversionFunction(receiverType: FirImplicitBuiltinTypeRef, name: Name): FirNamedFunctionSymbol {
|
||||||
return receiverType.type.scope(session, scopeSession, FakeOverrideTypeCalculator.DoNothing)!!.getFunctions(name).single()
|
return receiverType.type.scope(session, scopeSession, FakeOverrideTypeCalculator.DoNothing, requiredPhase = FirResolvePhase.STATUS)!!
|
||||||
|
.getFunctions(name).single()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun <E : FirElement> transformElement(element: E, data: ConeKotlinType?): E {
|
override fun <E : FirElement> transformElement(element: E, data: ConeKotlinType?): E {
|
||||||
|
|||||||
+9
-2
@@ -633,7 +633,8 @@ object FirExpectActualResolver {
|
|||||||
scopeSession: ScopeSession,
|
scopeSession: ScopeSession,
|
||||||
session: FirSession = moduleData.session
|
session: FirSession = moduleData.session
|
||||||
): Collection<FirBasedSymbol<*>> {
|
): Collection<FirBasedSymbol<*>> {
|
||||||
val scope = defaultType().scope(useSiteSession = session, scopeSession, FakeOverrideTypeCalculator.DoNothing)
|
val scope = defaultType()
|
||||||
|
.scope(useSiteSession = session, scopeSession, FakeOverrideTypeCalculator.DoNothing, requiredPhase = FirResolvePhase.STATUS)
|
||||||
?: return emptyList()
|
?: return emptyList()
|
||||||
return mutableListOf<FirBasedSymbol<*>>().apply {
|
return mutableListOf<FirBasedSymbol<*>>().apply {
|
||||||
for (name in scope.getCallableNames()) {
|
for (name in scope.getCallableNames()) {
|
||||||
@@ -660,7 +661,13 @@ object FirExpectActualResolver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun FirClassSymbol<*>.getMembers(name: Name, scopeSession: ScopeSession): Collection<FirCallableSymbol<*>> {
|
private fun FirClassSymbol<*>.getMembers(name: Name, scopeSession: ScopeSession): Collection<FirCallableSymbol<*>> {
|
||||||
val scope = defaultType().scope(useSiteSession = moduleData.session, scopeSession, FakeOverrideTypeCalculator.DoNothing)
|
val scope = defaultType()
|
||||||
|
.scope(
|
||||||
|
useSiteSession = moduleData.session,
|
||||||
|
scopeSession,
|
||||||
|
FakeOverrideTypeCalculator.DoNothing,
|
||||||
|
requiredPhase = FirResolvePhase.STATUS
|
||||||
|
)
|
||||||
?: return emptyList()
|
?: return emptyList()
|
||||||
return mutableListOf<FirCallableSymbol<*>>().apply {
|
return mutableListOf<FirCallableSymbol<*>>().apply {
|
||||||
scope.getMembersTo(this, name)
|
scope.getMembersTo(this, name)
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// FIR_IDENTICAL
|
// FIR_IDENTICAL
|
||||||
interface A<H> {
|
interface A<H> {
|
||||||
fun foo() : Int = 1
|
fun foo() : Int = 1
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// FIR_IDENTICAL
|
// FIR_IDENTICAL
|
||||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
|
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
|
||||||
|
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
abstract class A : Function1<Any, Unit>
|
abstract class A : Function1<Any, Unit>
|
||||||
|
|
||||||
abstract class B : (Int)->Unit
|
abstract class B : (Int)->Unit
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
abstract class A : Function1<Any, Unit>
|
abstract class A : Function1<Any, Unit>
|
||||||
|
|
||||||
abstract class B : (Int)->Unit
|
abstract class B : (Int)->Unit
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// FIR_IDENTICAL
|
// FIR_IDENTICAL
|
||||||
|
|
||||||
interface Aaa<T> {
|
interface Aaa<T> {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// WITH_EXTENDED_CHECKERS
|
// WITH_EXTENDED_CHECKERS
|
||||||
|
|
||||||
// FILE: a.kt
|
// FILE: a.kt
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// WITH_EXTENDED_CHECKERS
|
// WITH_EXTENDED_CHECKERS
|
||||||
|
|
||||||
// FILE: a.kt
|
// FILE: a.kt
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// FIR_IDENTICAL
|
// FIR_IDENTICAL
|
||||||
class X {
|
class X {
|
||||||
<!MUST_BE_INITIALIZED_OR_BE_ABSTRACT!>val x : Int<!>
|
<!MUST_BE_INITIALIZED_OR_BE_ABSTRACT!>val x : Int<!>
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
|
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
|
||||||
|
|
||||||
annotation class Ann
|
annotation class Ann
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
|
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
|
||||||
|
|
||||||
annotation class Ann
|
annotation class Ann
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !RENDER_DIAGNOSTICS_MESSAGES
|
// !RENDER_DIAGNOSTICS_MESSAGES
|
||||||
|
|
||||||
@Target(AnnotationTarget.FUNCTION, AnnotationTarget.TYPE, AnnotationTarget.CLASS, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.PROPERTY)
|
@Target(AnnotationTarget.FUNCTION, AnnotationTarget.TYPE, AnnotationTarget.CLASS, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.PROPERTY)
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !RENDER_DIAGNOSTICS_MESSAGES
|
// !RENDER_DIAGNOSTICS_MESSAGES
|
||||||
|
|
||||||
@Target(AnnotationTarget.FUNCTION, AnnotationTarget.TYPE, AnnotationTarget.CLASS, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.PROPERTY)
|
@Target(AnnotationTarget.FUNCTION, AnnotationTarget.TYPE, AnnotationTarget.CLASS, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.PROPERTY)
|
||||||
|
|||||||
Vendored
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// FIR_IDENTICAL
|
// FIR_IDENTICAL
|
||||||
import kotlin.reflect.KMutableProperty0
|
import kotlin.reflect.KMutableProperty0
|
||||||
|
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// FILE: a.kt
|
// FILE: a.kt
|
||||||
package test
|
package test
|
||||||
|
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// FILE: a.kt
|
// FILE: a.kt
|
||||||
package test
|
package test
|
||||||
|
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// See KT-15566
|
// See KT-15566
|
||||||
// NI_EXPECTED_FILE
|
// NI_EXPECTED_FILE
|
||||||
|
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// See KT-15566
|
// See KT-15566
|
||||||
// NI_EXPECTED_FILE
|
// NI_EXPECTED_FILE
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION
|
// !DIAGNOSTICS: -UNUSED_EXPRESSION
|
||||||
// !CHECK_TYPE
|
// !CHECK_TYPE
|
||||||
// Issue: KT-30406
|
// Issue: KT-30406
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION
|
// !DIAGNOSTICS: -UNUSED_EXPRESSION
|
||||||
// !CHECK_TYPE
|
// !CHECK_TYPE
|
||||||
// Issue: KT-30406
|
// Issue: KT-30406
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !LANGUAGE: +SuspendFunctionAsSupertype
|
// !LANGUAGE: +SuspendFunctionAsSupertype
|
||||||
// SKIP_TXT
|
// SKIP_TXT
|
||||||
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS, -ABSTRACT_MEMBER_NOT_IMPLEMENTED, -ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED
|
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS, -ABSTRACT_MEMBER_NOT_IMPLEMENTED, -ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !LANGUAGE: +SuspendFunctionAsSupertype
|
// !LANGUAGE: +SuspendFunctionAsSupertype
|
||||||
// SKIP_TXT
|
// SKIP_TXT
|
||||||
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS, -ABSTRACT_MEMBER_NOT_IMPLEMENTED, -ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED
|
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS, -ABSTRACT_MEMBER_NOT_IMPLEMENTED, -ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !LANGUAGE: +SuspendFunctionAsSupertype
|
// !LANGUAGE: +SuspendFunctionAsSupertype
|
||||||
// SKIP_TXT
|
// SKIP_TXT
|
||||||
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS, -ABSTRACT_MEMBER_NOT_IMPLEMENTED, -ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED
|
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS, -ABSTRACT_MEMBER_NOT_IMPLEMENTED, -ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !LANGUAGE: +SuspendFunctionAsSupertype
|
// !LANGUAGE: +SuspendFunctionAsSupertype
|
||||||
// SKIP_TXT
|
// SKIP_TXT
|
||||||
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS, -ABSTRACT_MEMBER_NOT_IMPLEMENTED, -ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED
|
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS, -ABSTRACT_MEMBER_NOT_IMPLEMENTED, -ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !LANGUAGE: +SuspendFunctionAsSupertype
|
// !LANGUAGE: +SuspendFunctionAsSupertype
|
||||||
// SKIP_TXT
|
// SKIP_TXT
|
||||||
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS, -ABSTRACT_MEMBER_NOT_IMPLEMENTED, -ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED
|
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS, -ABSTRACT_MEMBER_NOT_IMPLEMENTED, -ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !LANGUAGE: +SuspendFunctionAsSupertype
|
// !LANGUAGE: +SuspendFunctionAsSupertype
|
||||||
// SKIP_TXT
|
// SKIP_TXT
|
||||||
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS, -ABSTRACT_MEMBER_NOT_IMPLEMENTED, -ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED
|
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS, -ABSTRACT_MEMBER_NOT_IMPLEMENTED, -ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !LANGUAGE: +SuspendFunctionAsSupertype
|
// !LANGUAGE: +SuspendFunctionAsSupertype
|
||||||
// SKIP_TXT
|
// SKIP_TXT
|
||||||
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS, -ABSTRACT_MEMBER_NOT_IMPLEMENTED, -ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED
|
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS, -ABSTRACT_MEMBER_NOT_IMPLEMENTED, -ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !LANGUAGE: +SuspendFunctionAsSupertype
|
// !LANGUAGE: +SuspendFunctionAsSupertype
|
||||||
// SKIP_TXT
|
// SKIP_TXT
|
||||||
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS, -ABSTRACT_MEMBER_NOT_IMPLEMENTED, -ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED
|
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS, -ABSTRACT_MEMBER_NOT_IMPLEMENTED, -ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// FIR_IDENTICAL
|
// FIR_IDENTICAL
|
||||||
// !LANGUAGE: +SuspendFunctionAsSupertype
|
// !LANGUAGE: +SuspendFunctionAsSupertype
|
||||||
// SKIP_TXT
|
// SKIP_TXT
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !LANGUAGE: +SuspendFunctionAsSupertype
|
// !LANGUAGE: +SuspendFunctionAsSupertype
|
||||||
// SKIP_TXT
|
// SKIP_TXT
|
||||||
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS
|
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !LANGUAGE: +SuspendFunctionAsSupertype
|
// !LANGUAGE: +SuspendFunctionAsSupertype
|
||||||
// SKIP_TXT
|
// SKIP_TXT
|
||||||
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS
|
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !LANGUAGE: +SuspendFunctionAsSupertype
|
// !LANGUAGE: +SuspendFunctionAsSupertype
|
||||||
// SKIP_TXT
|
// SKIP_TXT
|
||||||
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS
|
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !LANGUAGE: +SuspendFunctionAsSupertype
|
// !LANGUAGE: +SuspendFunctionAsSupertype
|
||||||
// SKIP_TXT
|
// SKIP_TXT
|
||||||
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS
|
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !LANGUAGE: +SuspendFunctionAsSupertype
|
// !LANGUAGE: +SuspendFunctionAsSupertype
|
||||||
// SKIP_TXT
|
// SKIP_TXT
|
||||||
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS
|
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !LANGUAGE: +SuspendFunctionAsSupertype
|
// !LANGUAGE: +SuspendFunctionAsSupertype
|
||||||
// SKIP_TXT
|
// SKIP_TXT
|
||||||
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS
|
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !LANGUAGE: +SuspendFunctionAsSupertype
|
// !LANGUAGE: +SuspendFunctionAsSupertype
|
||||||
// SKIP_TXT
|
// SKIP_TXT
|
||||||
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS
|
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !LANGUAGE: +SuspendFunctionAsSupertype
|
// !LANGUAGE: +SuspendFunctionAsSupertype
|
||||||
// SKIP_TXT
|
// SKIP_TXT
|
||||||
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS
|
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// FIR_IDENTICAL
|
// FIR_IDENTICAL
|
||||||
// !LANGUAGE: +SuspendFunctionAsSupertype
|
// !LANGUAGE: +SuspendFunctionAsSupertype
|
||||||
// SKIP_TXT
|
// SKIP_TXT
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !LANGUAGE: +SuspendFunctionAsSupertype
|
// !LANGUAGE: +SuspendFunctionAsSupertype
|
||||||
// SKIP_TXT
|
// SKIP_TXT
|
||||||
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS
|
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !LANGUAGE: +SuspendFunctionAsSupertype
|
// !LANGUAGE: +SuspendFunctionAsSupertype
|
||||||
// SKIP_TXT
|
// SKIP_TXT
|
||||||
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS
|
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !LANGUAGE: +SuspendFunctionAsSupertype
|
// !LANGUAGE: +SuspendFunctionAsSupertype
|
||||||
// SKIP_TXT
|
// SKIP_TXT
|
||||||
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS
|
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !LANGUAGE: +SuspendFunctionAsSupertype
|
// !LANGUAGE: +SuspendFunctionAsSupertype
|
||||||
// SKIP_TXT
|
// SKIP_TXT
|
||||||
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS
|
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !LANGUAGE: +SuspendFunctionAsSupertype
|
// !LANGUAGE: +SuspendFunctionAsSupertype
|
||||||
// SKIP_TXT
|
// SKIP_TXT
|
||||||
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS
|
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !LANGUAGE: +SuspendFunctionAsSupertype
|
// !LANGUAGE: +SuspendFunctionAsSupertype
|
||||||
// SKIP_TXT
|
// SKIP_TXT
|
||||||
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS
|
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !LANGUAGE: +SuspendFunctionAsSupertype
|
// !LANGUAGE: +SuspendFunctionAsSupertype
|
||||||
// SKIP_TXT
|
// SKIP_TXT
|
||||||
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS
|
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !LANGUAGE: +SuspendFunctionAsSupertype
|
// !LANGUAGE: +SuspendFunctionAsSupertype
|
||||||
// SKIP_TXT
|
// SKIP_TXT
|
||||||
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS
|
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS
|
||||||
|
|||||||
compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/suspendFunctionN/simple.kt
Vendored
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// FIR_IDENTICAL
|
// FIR_IDENTICAL
|
||||||
// !LANGUAGE: +SuspendFunctionAsSupertype
|
// !LANGUAGE: +SuspendFunctionAsSupertype
|
||||||
// SKIP_TXT
|
// SKIP_TXT
|
||||||
|
|||||||
Vendored
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !LANGUAGE: +ProhibitDataClassesOverridingCopy
|
// !LANGUAGE: +ProhibitDataClassesOverridingCopy
|
||||||
|
|
||||||
interface WithCopy<T> {
|
interface WithCopy<T> {
|
||||||
|
|||||||
Vendored
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !LANGUAGE: +ProhibitDataClassesOverridingCopy
|
// !LANGUAGE: +ProhibitDataClassesOverridingCopy
|
||||||
|
|
||||||
interface WithCopy<T> {
|
interface WithCopy<T> {
|
||||||
|
|||||||
compiler/testData/diagnostics/tests/dataClasses/dataClassExplicitlyOverridingCopyWithDefaults.fir.kt
Vendored
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !LANGUAGE: +ProhibitDataClassesOverridingCopy
|
// !LANGUAGE: +ProhibitDataClassesOverridingCopy
|
||||||
|
|
||||||
interface WithCopy<T> {
|
interface WithCopy<T> {
|
||||||
|
|||||||
Vendored
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !LANGUAGE: +ProhibitDataClassesOverridingCopy
|
// !LANGUAGE: +ProhibitDataClassesOverridingCopy
|
||||||
|
|
||||||
interface WithCopy<T> {
|
interface WithCopy<T> {
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user