[K2 AA] add missing receiverType for getter and setter
^KT-54311
This commit is contained in:
committed by
Space Team
parent
afe7605649
commit
027899a22a
+4
-7
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
@@ -22,10 +22,7 @@ import org.jetbrains.kotlin.descriptors.Modality
|
||||
import org.jetbrains.kotlin.descriptors.Visibility
|
||||
import org.jetbrains.kotlin.fir.declarations.impl.FirDefaultPropertyAccessor
|
||||
import org.jetbrains.kotlin.fir.declarations.synthetic.FirSyntheticPropertyAccessor
|
||||
import org.jetbrains.kotlin.fir.declarations.utils.isInline
|
||||
import org.jetbrains.kotlin.fir.declarations.utils.isOverride
|
||||
import org.jetbrains.kotlin.fir.declarations.utils.modalityOrFinal
|
||||
import org.jetbrains.kotlin.fir.declarations.utils.visibility
|
||||
import org.jetbrains.kotlin.fir.declarations.utils.*
|
||||
import org.jetbrains.kotlin.fir.resolve.getHasStableParameterNames
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirPropertyAccessorSymbol
|
||||
import org.jetbrains.kotlin.name.CallableId
|
||||
@@ -50,14 +47,14 @@ internal class KtFirPropertyGetterSymbol(
|
||||
return firSymbol.fir.propertySymbol.isOverride
|
||||
}
|
||||
|
||||
override val hasBody: Boolean get() = withValidityAssertion { firSymbol.fir.body != null }
|
||||
override val hasBody: Boolean get() = withValidityAssertion { firSymbol.fir.hasBody }
|
||||
|
||||
override val modality: Modality get() = withValidityAssertion { firSymbol.modalityOrFinal }
|
||||
override val visibility: Visibility get() = withValidityAssertion { firSymbol.visibility }
|
||||
|
||||
|
||||
override val returnType: KtType get() = withValidityAssertion { firSymbol.returnType(builder) }
|
||||
override val receiverType: KtType? get() = withValidityAssertion { firSymbol.receiverType(builder) }
|
||||
override val receiverType: KtType? get() = withValidityAssertion { firSymbol.fir.propertySymbol.receiverType(builder) }
|
||||
|
||||
override val annotationsList by cached { KtFirAnnotationListForDeclaration.create(firSymbol, firResolveSession.useSiteFirSession, token) }
|
||||
|
||||
|
||||
+4
-7
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
@@ -22,10 +22,7 @@ import org.jetbrains.kotlin.descriptors.Modality
|
||||
import org.jetbrains.kotlin.descriptors.Visibility
|
||||
import org.jetbrains.kotlin.fir.declarations.impl.FirDefaultPropertyAccessor
|
||||
import org.jetbrains.kotlin.fir.declarations.synthetic.FirSyntheticPropertyAccessor
|
||||
import org.jetbrains.kotlin.fir.declarations.utils.isInline
|
||||
import org.jetbrains.kotlin.fir.declarations.utils.isOverride
|
||||
import org.jetbrains.kotlin.fir.declarations.utils.modalityOrFinal
|
||||
import org.jetbrains.kotlin.fir.declarations.utils.visibility
|
||||
import org.jetbrains.kotlin.fir.declarations.utils.*
|
||||
import org.jetbrains.kotlin.fir.resolve.getHasStableParameterNames
|
||||
import org.jetbrains.kotlin.fir.resolve.scope
|
||||
import org.jetbrains.kotlin.fir.scopes.FakeOverrideTypeCalculator
|
||||
@@ -63,7 +60,7 @@ internal class KtFirPropertySetterSymbol(
|
||||
overriddenProperties.any { it.isVar }
|
||||
}
|
||||
|
||||
override val hasBody: Boolean get() = withValidityAssertion { firSymbol.fir.body != null }
|
||||
override val hasBody: Boolean get() = withValidityAssertion { firSymbol.fir.hasBody }
|
||||
|
||||
override val modality: Modality get() = withValidityAssertion { firSymbol.modalityOrFinal }
|
||||
override val visibility: Visibility get() = withValidityAssertion { firSymbol.visibility }
|
||||
@@ -94,7 +91,7 @@ internal class KtFirPropertySetterSymbol(
|
||||
override val valueParameters: List<KtValueParameterSymbol> by cached { listOf(parameter) }
|
||||
|
||||
override val returnType: KtType get() = withValidityAssertion { firSymbol.returnType(builder) }
|
||||
override val receiverType: KtType? get() = withValidityAssertion { firSymbol.receiverType(builder) }
|
||||
override val receiverType: KtType? get() = withValidityAssertion { firSymbol.fir.propertySymbol.receiverType(builder) }
|
||||
|
||||
|
||||
override val hasStableParameterNames: Boolean
|
||||
|
||||
@@ -872,7 +872,7 @@ KtKotlinPropertySymbol:
|
||||
isOverride: false
|
||||
modality: FINAL
|
||||
origin: SOURCE
|
||||
receiverType: null
|
||||
receiverType: kotlin/Int
|
||||
returnType: kotlin/Int
|
||||
symbolKind: ACCESSOR
|
||||
typeParameters: []
|
||||
@@ -922,7 +922,7 @@ KtKotlinPropertySymbol:
|
||||
isOverride: false
|
||||
modality: FINAL
|
||||
origin: SOURCE
|
||||
receiverType: null
|
||||
receiverType: T
|
||||
returnType: kotlin/Int
|
||||
symbolKind: ACCESSOR
|
||||
typeParameters: []
|
||||
|
||||
@@ -61,7 +61,7 @@ KtPropertyGetterSymbol:
|
||||
isOverride: false
|
||||
modality: FINAL
|
||||
origin: SOURCE
|
||||
receiverType: null
|
||||
receiverType: kotlin/Int
|
||||
returnType: kotlin/Int
|
||||
symbolKind: ACCESSOR
|
||||
typeParameters: []
|
||||
@@ -86,7 +86,7 @@ KtKotlinPropertySymbol:
|
||||
isOverride: false
|
||||
modality: FINAL
|
||||
origin: SOURCE
|
||||
receiverType: null
|
||||
receiverType: kotlin/Int
|
||||
returnType: kotlin/Int
|
||||
symbolKind: ACCESSOR
|
||||
typeParameters: []
|
||||
|
||||
-120
@@ -1,120 +0,0 @@
|
||||
KtKotlinPropertySymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: /x
|
||||
contextReceivers: []
|
||||
getter: KtPropertyGetterSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: null
|
||||
contextReceivers: []
|
||||
hasBody: false
|
||||
hasStableParameterNames: true
|
||||
isDefault: true
|
||||
isExtension: false
|
||||
isInline: false
|
||||
isOverride: false
|
||||
modality: FINAL
|
||||
origin: SOURCE
|
||||
receiverType: null
|
||||
returnType: kotlin/Int
|
||||
symbolKind: ACCESSOR
|
||||
typeParameters: []
|
||||
valueParameters: []
|
||||
visibility: Public
|
||||
hasBackingField: true
|
||||
hasGetter: true
|
||||
hasSetter: false
|
||||
initializer: KtConstantInitializerValue(10)
|
||||
isConst: false
|
||||
isDelegatedProperty: false
|
||||
isExtension: false
|
||||
isFromPrimaryConstructor: false
|
||||
isLateInit: false
|
||||
isOverride: false
|
||||
isStatic: false
|
||||
isVal: true
|
||||
modality: FINAL
|
||||
name: x
|
||||
origin: SOURCE
|
||||
receiverType: null
|
||||
returnType: kotlin/Int
|
||||
setter: null
|
||||
symbolKind: TOP_LEVEL
|
||||
typeParameters: []
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
getterDeprecationStatus: null
|
||||
javaGetterName: getX
|
||||
javaSetterName: null
|
||||
setterDeprecationStatus: null
|
||||
|
||||
KtPropertyGetterSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: null
|
||||
contextReceivers: []
|
||||
hasBody: true
|
||||
hasStableParameterNames: true
|
||||
isDefault: false
|
||||
isExtension: false
|
||||
isInline: false
|
||||
isOverride: false
|
||||
modality: FINAL
|
||||
origin: SOURCE
|
||||
receiverType: kotlin/Int
|
||||
returnType: kotlin/Int
|
||||
symbolKind: ACCESSOR
|
||||
typeParameters: []
|
||||
valueParameters: []
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
|
||||
KtKotlinPropertySymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: /y
|
||||
contextReceivers: []
|
||||
getter: KtPropertyGetterSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: null
|
||||
contextReceivers: []
|
||||
hasBody: true
|
||||
hasStableParameterNames: true
|
||||
isDefault: false
|
||||
isExtension: false
|
||||
isInline: false
|
||||
isOverride: false
|
||||
modality: FINAL
|
||||
origin: SOURCE
|
||||
receiverType: kotlin/Int
|
||||
returnType: kotlin/Int
|
||||
symbolKind: ACCESSOR
|
||||
typeParameters: []
|
||||
valueParameters: []
|
||||
visibility: Public
|
||||
hasBackingField: false
|
||||
hasGetter: true
|
||||
hasSetter: false
|
||||
initializer: null
|
||||
isConst: false
|
||||
isDelegatedProperty: false
|
||||
isExtension: true
|
||||
isFromPrimaryConstructor: false
|
||||
isLateInit: false
|
||||
isOverride: false
|
||||
isStatic: false
|
||||
isVal: true
|
||||
modality: FINAL
|
||||
name: y
|
||||
origin: SOURCE
|
||||
receiverType: kotlin/Int
|
||||
returnType: kotlin/Int
|
||||
setter: null
|
||||
symbolKind: TOP_LEVEL
|
||||
typeParameters: []
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
getterDeprecationStatus: null
|
||||
javaGetterName: getY
|
||||
javaSetterName: null
|
||||
setterDeprecationStatus: null
|
||||
@@ -1,2 +1,6 @@
|
||||
val x: Int = 10
|
||||
val Int.y get() = this
|
||||
|
||||
var Short.get: Long
|
||||
get() = 2
|
||||
set(value) {}
|
||||
+3
-1
@@ -1,3 +1,5 @@
|
||||
val x: kotlin.Int
|
||||
|
||||
val kotlin.Int.y: kotlin.Int
|
||||
val kotlin.Int.y: kotlin.Int
|
||||
|
||||
var kotlin.Short.get: kotlin.Long
|
||||
+201
-2
@@ -60,7 +60,7 @@ KtPropertyGetterSymbol:
|
||||
isOverride: false
|
||||
modality: FINAL
|
||||
origin: SOURCE
|
||||
receiverType: null
|
||||
receiverType: kotlin/Int
|
||||
returnType: kotlin/Int
|
||||
symbolKind: ACCESSOR
|
||||
typeParameters: []
|
||||
@@ -85,7 +85,7 @@ KtKotlinPropertySymbol:
|
||||
isOverride: false
|
||||
modality: FINAL
|
||||
origin: SOURCE
|
||||
receiverType: null
|
||||
receiverType: kotlin/Int
|
||||
returnType: kotlin/Int
|
||||
symbolKind: ACCESSOR
|
||||
typeParameters: []
|
||||
@@ -117,4 +117,203 @@ KtKotlinPropertySymbol:
|
||||
getterDeprecationStatus: null
|
||||
javaGetterName: getY
|
||||
javaSetterName: null
|
||||
setterDeprecationStatus: null
|
||||
|
||||
KtPropertyGetterSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: null
|
||||
contextReceivers: []
|
||||
hasBody: true
|
||||
hasStableParameterNames: true
|
||||
isDefault: false
|
||||
isExtension: false
|
||||
isInline: false
|
||||
isOverride: false
|
||||
modality: FINAL
|
||||
origin: SOURCE
|
||||
receiverType: kotlin/Short
|
||||
returnType: kotlin/Long
|
||||
symbolKind: ACCESSOR
|
||||
typeParameters: []
|
||||
valueParameters: []
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
|
||||
KtValueParameterSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: null
|
||||
contextReceivers: []
|
||||
generatedPrimaryConstructorProperty: null
|
||||
hasDefaultValue: false
|
||||
isCrossinline: false
|
||||
isExtension: false
|
||||
isImplicitLambdaParameter: false
|
||||
isNoinline: false
|
||||
isVararg: false
|
||||
name: value
|
||||
origin: SOURCE
|
||||
receiverType: null
|
||||
returnType: kotlin/Long
|
||||
symbolKind: LOCAL
|
||||
typeParameters: []
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
|
||||
KtPropertySetterSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: null
|
||||
contextReceivers: []
|
||||
hasBody: true
|
||||
hasStableParameterNames: true
|
||||
isDefault: false
|
||||
isExtension: false
|
||||
isInline: false
|
||||
isOverride: false
|
||||
modality: FINAL
|
||||
origin: SOURCE
|
||||
parameter: KtValueParameterSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: null
|
||||
contextReceivers: []
|
||||
generatedPrimaryConstructorProperty: null
|
||||
hasDefaultValue: false
|
||||
isCrossinline: false
|
||||
isExtension: false
|
||||
isImplicitLambdaParameter: false
|
||||
isNoinline: false
|
||||
isVararg: false
|
||||
name: value
|
||||
origin: SOURCE
|
||||
receiverType: null
|
||||
returnType: kotlin/Long
|
||||
symbolKind: LOCAL
|
||||
typeParameters: []
|
||||
receiverType: kotlin/Short
|
||||
returnType: kotlin/Unit
|
||||
symbolKind: ACCESSOR
|
||||
typeParameters: []
|
||||
valueParameters: [
|
||||
KtValueParameterSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: null
|
||||
contextReceivers: []
|
||||
generatedPrimaryConstructorProperty: null
|
||||
hasDefaultValue: false
|
||||
isCrossinline: false
|
||||
isExtension: false
|
||||
isImplicitLambdaParameter: false
|
||||
isNoinline: false
|
||||
isVararg: false
|
||||
name: value
|
||||
origin: SOURCE
|
||||
receiverType: null
|
||||
returnType: kotlin/Long
|
||||
symbolKind: LOCAL
|
||||
typeParameters: []
|
||||
]
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
|
||||
KtKotlinPropertySymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: /get
|
||||
contextReceivers: []
|
||||
getter: KtPropertyGetterSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: null
|
||||
contextReceivers: []
|
||||
hasBody: true
|
||||
hasStableParameterNames: true
|
||||
isDefault: false
|
||||
isExtension: false
|
||||
isInline: false
|
||||
isOverride: false
|
||||
modality: FINAL
|
||||
origin: SOURCE
|
||||
receiverType: kotlin/Short
|
||||
returnType: kotlin/Long
|
||||
symbolKind: ACCESSOR
|
||||
typeParameters: []
|
||||
valueParameters: []
|
||||
visibility: Public
|
||||
hasBackingField: false
|
||||
hasGetter: true
|
||||
hasSetter: true
|
||||
initializer: null
|
||||
isConst: false
|
||||
isDelegatedProperty: false
|
||||
isExtension: true
|
||||
isFromPrimaryConstructor: false
|
||||
isLateInit: false
|
||||
isOverride: false
|
||||
isStatic: false
|
||||
isVal: false
|
||||
modality: FINAL
|
||||
name: get
|
||||
origin: SOURCE
|
||||
receiverType: kotlin/Short
|
||||
returnType: kotlin/Long
|
||||
setter: KtPropertySetterSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: null
|
||||
contextReceivers: []
|
||||
hasBody: true
|
||||
hasStableParameterNames: true
|
||||
isDefault: false
|
||||
isExtension: false
|
||||
isInline: false
|
||||
isOverride: false
|
||||
modality: FINAL
|
||||
origin: SOURCE
|
||||
parameter: KtValueParameterSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: null
|
||||
contextReceivers: []
|
||||
generatedPrimaryConstructorProperty: null
|
||||
hasDefaultValue: false
|
||||
isCrossinline: false
|
||||
isExtension: false
|
||||
isImplicitLambdaParameter: false
|
||||
isNoinline: false
|
||||
isVararg: false
|
||||
name: value
|
||||
origin: SOURCE
|
||||
receiverType: null
|
||||
returnType: kotlin/Long
|
||||
symbolKind: LOCAL
|
||||
typeParameters: []
|
||||
receiverType: kotlin/Short
|
||||
returnType: kotlin/Unit
|
||||
symbolKind: ACCESSOR
|
||||
typeParameters: []
|
||||
valueParameters: [
|
||||
KtValueParameterSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: null
|
||||
contextReceivers: []
|
||||
generatedPrimaryConstructorProperty: null
|
||||
hasDefaultValue: false
|
||||
isCrossinline: false
|
||||
isExtension: false
|
||||
isImplicitLambdaParameter: false
|
||||
isNoinline: false
|
||||
isVararg: false
|
||||
name: value
|
||||
origin: SOURCE
|
||||
receiverType: null
|
||||
returnType: kotlin/Long
|
||||
symbolKind: LOCAL
|
||||
typeParameters: []
|
||||
]
|
||||
visibility: Public
|
||||
symbolKind: TOP_LEVEL
|
||||
typeParameters: []
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
getterDeprecationStatus: null
|
||||
javaGetterName: getGet
|
||||
javaSetterName: setGet
|
||||
setterDeprecationStatus: null
|
||||
Reference in New Issue
Block a user