[FIR] Report deprecation on synthetic property calls on super receivers
#KT-65438 Fixed
This commit is contained in:
committed by
Space Team
parent
35e9170af1
commit
e39af4583e
@@ -46,6 +46,7 @@ class FirSyntheticPropertiesScope private constructor(
|
|||||||
private val dispatchReceiverType: ConeKotlinType,
|
private val dispatchReceiverType: ConeKotlinType,
|
||||||
private val syntheticNamesProvider: FirSyntheticNamesProvider,
|
private val syntheticNamesProvider: FirSyntheticNamesProvider,
|
||||||
private val returnTypeCalculator: ReturnTypeCalculator?,
|
private val returnTypeCalculator: ReturnTypeCalculator?,
|
||||||
|
private val isSuperCall: Boolean,
|
||||||
) : FirContainingNamesAwareScope() {
|
) : FirContainingNamesAwareScope() {
|
||||||
companion object {
|
companion object {
|
||||||
fun createIfSyntheticNamesProviderIsDefined(
|
fun createIfSyntheticNamesProviderIsDefined(
|
||||||
@@ -53,6 +54,7 @@ class FirSyntheticPropertiesScope private constructor(
|
|||||||
dispatchReceiverType: ConeKotlinType,
|
dispatchReceiverType: ConeKotlinType,
|
||||||
baseScope: FirTypeScope,
|
baseScope: FirTypeScope,
|
||||||
returnTypeCalculator: ReturnTypeCalculator? = null,
|
returnTypeCalculator: ReturnTypeCalculator? = null,
|
||||||
|
isSuperCall: Boolean = false,
|
||||||
): FirSyntheticPropertiesScope? {
|
): FirSyntheticPropertiesScope? {
|
||||||
val syntheticNamesProvider = session.syntheticNamesProvider ?: return null
|
val syntheticNamesProvider = session.syntheticNamesProvider ?: return null
|
||||||
return FirSyntheticPropertiesScope(
|
return FirSyntheticPropertiesScope(
|
||||||
@@ -61,6 +63,7 @@ class FirSyntheticPropertiesScope private constructor(
|
|||||||
dispatchReceiverType,
|
dispatchReceiverType,
|
||||||
syntheticNamesProvider,
|
syntheticNamesProvider,
|
||||||
returnTypeCalculator,
|
returnTypeCalculator,
|
||||||
|
isSuperCall,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -229,7 +232,7 @@ class FirSyntheticPropertiesScope private constructor(
|
|||||||
baseScope.processDirectOverriddenFunctionsWithBaseScope(symbolToStart) l@{ symbol, scope ->
|
baseScope.processDirectOverriddenFunctionsWithBaseScope(symbolToStart) l@{ symbol, scope ->
|
||||||
if (hasMatchingSetter) return@l ProcessorAction.STOP
|
if (hasMatchingSetter) return@l ProcessorAction.STOP
|
||||||
val baseDispatchReceiverType = symbol.dispatchReceiverType ?: return@l ProcessorAction.NEXT
|
val baseDispatchReceiverType = symbol.dispatchReceiverType ?: return@l ProcessorAction.NEXT
|
||||||
val syntheticScope = FirSyntheticPropertiesScope(session, scope, baseDispatchReceiverType, syntheticNamesProvider, returnTypeCalculator)
|
val syntheticScope = FirSyntheticPropertiesScope(session, scope, baseDispatchReceiverType, syntheticNamesProvider, returnTypeCalculator, isSuperCall)
|
||||||
val baseProperties = syntheticScope.getProperties(propertyName)
|
val baseProperties = syntheticScope.getProperties(propertyName)
|
||||||
val propertyFound = baseProperties.any {
|
val propertyFound = baseProperties.any {
|
||||||
val baseProperty = it.fir
|
val baseProperty = it.fir
|
||||||
@@ -272,7 +275,7 @@ class FirSyntheticPropertiesScope private constructor(
|
|||||||
|
|
||||||
val visited = mutableSetOf<MemberWithBaseScope<FirNamedFunctionSymbol>>()
|
val visited = mutableSetOf<MemberWithBaseScope<FirNamedFunctionSymbol>>()
|
||||||
fun checkJavaOrigin(symbol: FirNamedFunctionSymbol, scope: FirTypeScope, isOverridden: Boolean) {
|
fun checkJavaOrigin(symbol: FirNamedFunctionSymbol, scope: FirTypeScope, isOverridden: Boolean) {
|
||||||
val hidden = symbol.hiddenStatusOfCall(isSuperCall = false, isCallToOverride = isOverridden)
|
val hidden = symbol.hiddenStatusOfCall(isSuperCall = isSuperCall, isCallToOverride = isOverridden)
|
||||||
when (hidden) {
|
when (hidden) {
|
||||||
CallToPotentiallyHiddenSymbolResult.Hidden -> isHiddenEverywhereBesideSuperCalls = true
|
CallToPotentiallyHiddenSymbolResult.Hidden -> isHiddenEverywhereBesideSuperCalls = true
|
||||||
CallToPotentiallyHiddenSymbolResult.VisibleWithDeprecation -> isDeprecatedOverrideOfHidden = true
|
CallToPotentiallyHiddenSymbolResult.VisibleWithDeprecation -> isDeprecatedOverrideOfHidden = true
|
||||||
|
|||||||
@@ -802,12 +802,11 @@ internal object CheckHiddenDeclaration : ResolutionStage() {
|
|||||||
|
|
||||||
return hidden
|
return hidden
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun FirElement.isSuperCall(session: FirSession): Boolean =
|
|
||||||
this is FirQualifiedAccessExpression && explicitReceiver?.toReference(session) is FirSuperReference
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal fun FirElement.isSuperCall(session: FirSession): Boolean =
|
||||||
|
this is FirQualifiedAccessExpression && explicitReceiver?.toReference(session) is FirSuperReference
|
||||||
|
|
||||||
private val DYNAMIC_EXTENSION_ANNOTATION_CLASS_ID: ClassId = ClassId.topLevel(DYNAMIC_EXTENSION_FQ_NAME)
|
private val DYNAMIC_EXTENSION_ANNOTATION_CLASS_ID: ClassId = ClassId.topLevel(DYNAMIC_EXTENSION_FQ_NAME)
|
||||||
|
|
||||||
internal object ProcessDynamicExtensionAnnotation : ResolutionStage() {
|
internal object ProcessDynamicExtensionAnnotation : ResolutionStage() {
|
||||||
|
|||||||
+4
-2
@@ -81,6 +81,7 @@ class MemberScopeTowerLevel(
|
|||||||
private val session: FirSession get() = bodyResolveComponents.session
|
private val session: FirSession get() = bodyResolveComponents.session
|
||||||
|
|
||||||
private fun <T : FirCallableSymbol<*>> processMembers(
|
private fun <T : FirCallableSymbol<*>> processMembers(
|
||||||
|
info: CallInfo,
|
||||||
output: TowerScopeLevelProcessor<T>,
|
output: TowerScopeLevelProcessor<T>,
|
||||||
processScopeMembers: FirScope.(processor: (T) -> Unit) -> Unit
|
processScopeMembers: FirScope.(processor: (T) -> Unit) -> Unit
|
||||||
): ProcessResult {
|
): ProcessResult {
|
||||||
@@ -165,6 +166,7 @@ class MemberScopeTowerLevel(
|
|||||||
typeForSyntheticScope,
|
typeForSyntheticScope,
|
||||||
useSiteForSyntheticScope,
|
useSiteForSyntheticScope,
|
||||||
bodyResolveComponents.returnTypeCalculator,
|
bodyResolveComponents.returnTypeCalculator,
|
||||||
|
isSuperCall = info.callSite.isSuperCall(session),
|
||||||
)
|
)
|
||||||
|
|
||||||
withSynthetic?.processScopeMembers { symbol ->
|
withSynthetic?.processScopeMembers { symbol ->
|
||||||
@@ -274,7 +276,7 @@ class MemberScopeTowerLevel(
|
|||||||
processor: TowerScopeLevelProcessor<FirFunctionSymbol<*>>
|
processor: TowerScopeLevelProcessor<FirFunctionSymbol<*>>
|
||||||
): ProcessResult {
|
): ProcessResult {
|
||||||
val lookupTracker = session.lookupTracker
|
val lookupTracker = session.lookupTracker
|
||||||
return processMembers(processor) { consumer ->
|
return processMembers(info, processor) { consumer ->
|
||||||
withMemberCallLookup(lookupTracker, info) { lookupCtx ->
|
withMemberCallLookup(lookupTracker, info) { lookupCtx ->
|
||||||
this.processFunctionsAndConstructorsByName(
|
this.processFunctionsAndConstructorsByName(
|
||||||
info, session, bodyResolveComponents,
|
info, session, bodyResolveComponents,
|
||||||
@@ -294,7 +296,7 @@ class MemberScopeTowerLevel(
|
|||||||
processor: TowerScopeLevelProcessor<FirVariableSymbol<*>>
|
processor: TowerScopeLevelProcessor<FirVariableSymbol<*>>
|
||||||
): ProcessResult {
|
): ProcessResult {
|
||||||
val lookupTracker = session.lookupTracker
|
val lookupTracker = session.lookupTracker
|
||||||
return processMembers(processor) { consumer ->
|
return processMembers(info, processor) { consumer ->
|
||||||
withMemberCallLookup(lookupTracker, info) { lookupCtx ->
|
withMemberCallLookup(lookupTracker, info) { lookupCtx ->
|
||||||
lookupTracker?.recordCallLookup(info, dispatchReceiverValue.type)
|
lookupTracker?.recordCallLookup(info, dispatchReceiverValue.type)
|
||||||
this.processPropertiesByName(info.name) {
|
this.processPropertiesByName(info.name) {
|
||||||
|
|||||||
+22
-16
@@ -1,49 +1,55 @@
|
|||||||
/newListMethods.kt:13:18: warning: this declaration overrides deprecated member but not marked as deprecated itself. Please add @Deprecated annotation or suppress. See https://youtrack.jetbrains.com/issue/KT-47902 for details
|
/newListMethods.kt:15:18: warning: this declaration overrides deprecated member but not marked as deprecated itself. Please add @Deprecated annotation or suppress. See https://youtrack.jetbrains.com/issue/KT-47902 for details
|
||||||
override fun getFirst(): T = super.getFirst()
|
override fun getFirst(): T = super.getFirst()
|
||||||
^^^^^^^^
|
^^^^^^^^
|
||||||
/newListMethods.kt:13:40: warning: 'getFirst(): E!' is deprecated. Overrides deprecated member in 'java.util.AbstractList'. 'getFirst()' member of List is redundant in Kotlin and might be removed soon. Please use 'first()' stdlib extension instead
|
/newListMethods.kt:15:40: warning: 'getFirst(): E!' is deprecated. Overrides deprecated member in 'java.util.AbstractList'. 'getFirst()' member of List is redundant in Kotlin and might be removed soon. Please use 'first()' stdlib extension instead
|
||||||
override fun getFirst(): T = super.getFirst()
|
override fun getFirst(): T = super.getFirst()
|
||||||
^^^^^^^^
|
^^^^^^^^
|
||||||
/newListMethods.kt:14:18: warning: this declaration overrides deprecated member but not marked as deprecated itself. Please add @Deprecated annotation or suppress. See https://youtrack.jetbrains.com/issue/KT-47902 for details
|
/newListMethods.kt:16:18: warning: this declaration overrides deprecated member but not marked as deprecated itself. Please add @Deprecated annotation or suppress. See https://youtrack.jetbrains.com/issue/KT-47902 for details
|
||||||
override fun getLast(): T = super.getLast()
|
override fun getLast(): T = super.getLast()
|
||||||
^^^^^^^
|
^^^^^^^
|
||||||
/newListMethods.kt:14:39: warning: 'getLast(): E!' is deprecated. Overrides deprecated member in 'java.util.AbstractList'. 'getLast()' member of List is redundant in Kotlin and might be removed soon. Please use 'last()' stdlib extension instead
|
/newListMethods.kt:16:39: warning: 'getLast(): E!' is deprecated. Overrides deprecated member in 'java.util.AbstractList'. 'getLast()' member of List is redundant in Kotlin and might be removed soon. Please use 'last()' stdlib extension instead
|
||||||
override fun getLast(): T = super.getLast()
|
override fun getLast(): T = super.getLast()
|
||||||
^^^^^^^
|
^^^^^^^
|
||||||
/newListMethods.kt:25:7: warning: 'getFirst(): E!' is deprecated. 'getFirst()' member of List is redundant in Kotlin and might be removed soon. Please use 'first()' stdlib extension instead
|
/newListMethods.kt:18:34: warning: 'getFirst(): E!' is deprecated. Overrides deprecated member in 'java.util.AbstractList'. 'getFirst()' member of List is redundant in Kotlin and might be removed soon. Please use 'first()' stdlib extension instead
|
||||||
|
fun superFirst2(): T = super.first
|
||||||
|
^^^^^
|
||||||
|
/newListMethods.kt:19:33: warning: 'getLast(): E!' is deprecated. Overrides deprecated member in 'java.util.AbstractList'. 'getLast()' member of List is redundant in Kotlin and might be removed soon. Please use 'last()' stdlib extension instead
|
||||||
|
fun superLast2(): T = super.last
|
||||||
|
^^^^
|
||||||
|
/newListMethods.kt:30:7: warning: 'getFirst(): E!' is deprecated. 'getFirst()' member of List is redundant in Kotlin and might be removed soon. Please use 'first()' stdlib extension instead
|
||||||
x.getFirst()
|
x.getFirst()
|
||||||
^^^^^^^^
|
^^^^^^^^
|
||||||
/newListMethods.kt:26:7: warning: 'getter for first: E!' is deprecated. 'getFirst()' member of List is redundant in Kotlin and might be removed soon. Please use 'first()' stdlib extension instead
|
/newListMethods.kt:31:7: warning: 'getter for first: E!' is deprecated. 'getFirst()' member of List is redundant in Kotlin and might be removed soon. Please use 'first()' stdlib extension instead
|
||||||
x.first // synthetic property for getFirst()
|
x.first // synthetic property for getFirst()
|
||||||
^^^^^
|
^^^^^
|
||||||
/newListMethods.kt:28:7: warning: 'getLast(): E!' is deprecated. 'getLast()' member of List is redundant in Kotlin and might be removed soon. Please use 'last()' stdlib extension instead
|
/newListMethods.kt:33:7: warning: 'getLast(): E!' is deprecated. 'getLast()' member of List is redundant in Kotlin and might be removed soon. Please use 'last()' stdlib extension instead
|
||||||
x.getLast()
|
x.getLast()
|
||||||
^^^^^^^
|
^^^^^^^
|
||||||
/newListMethods.kt:29:7: warning: 'getter for last: E!' is deprecated. 'getLast()' member of List is redundant in Kotlin and might be removed soon. Please use 'last()' stdlib extension instead
|
/newListMethods.kt:34:7: warning: 'getter for last: E!' is deprecated. 'getLast()' member of List is redundant in Kotlin and might be removed soon. Please use 'last()' stdlib extension instead
|
||||||
x.last
|
x.last
|
||||||
^^^^
|
^^^^
|
||||||
/newListMethods.kt:37:7: warning: 'getFirst(): E!' is deprecated. Overrides deprecated member in 'java.util.AbstractList'. 'getFirst()' member of List is redundant in Kotlin and might be removed soon. Please use 'first()' stdlib extension instead
|
/newListMethods.kt:42:7: warning: 'getFirst(): E!' is deprecated. Overrides deprecated member in 'java.util.AbstractList'. 'getFirst()' member of List is redundant in Kotlin and might be removed soon. Please use 'first()' stdlib extension instead
|
||||||
y.getFirst()
|
y.getFirst()
|
||||||
^^^^^^^^
|
^^^^^^^^
|
||||||
/newListMethods.kt:38:7: warning: 'getFirst(): E!' is deprecated. Overrides deprecated member in 'java.util.AbstractList'. 'getFirst()' member of List is redundant in Kotlin and might be removed soon. Please use 'first()' stdlib extension instead
|
/newListMethods.kt:43:7: warning: 'getFirst(): E!' is deprecated. Overrides deprecated member in 'java.util.AbstractList'. 'getFirst()' member of List is redundant in Kotlin and might be removed soon. Please use 'first()' stdlib extension instead
|
||||||
y.first
|
y.first
|
||||||
^^^^^
|
^^^^^
|
||||||
/newListMethods.kt:40:7: warning: 'getLast(): E!' is deprecated. Overrides deprecated member in 'java.util.AbstractList'. 'getLast()' member of List is redundant in Kotlin and might be removed soon. Please use 'last()' stdlib extension instead
|
/newListMethods.kt:45:7: warning: 'getLast(): E!' is deprecated. Overrides deprecated member in 'java.util.AbstractList'. 'getLast()' member of List is redundant in Kotlin and might be removed soon. Please use 'last()' stdlib extension instead
|
||||||
y.getLast()
|
y.getLast()
|
||||||
^^^^^^^
|
^^^^^^^
|
||||||
/newListMethods.kt:41:7: warning: 'getLast(): E!' is deprecated. Overrides deprecated member in 'java.util.AbstractList'. 'getLast()' member of List is redundant in Kotlin and might be removed soon. Please use 'last()' stdlib extension instead
|
/newListMethods.kt:46:7: warning: 'getLast(): E!' is deprecated. Overrides deprecated member in 'java.util.AbstractList'. 'getLast()' member of List is redundant in Kotlin and might be removed soon. Please use 'last()' stdlib extension instead
|
||||||
y.last
|
y.last
|
||||||
^^^^
|
^^^^
|
||||||
/newListMethods.kt:49:7: warning: 'getFirst(): E!' is deprecated. Overrides deprecated member in 'java.util.AbstractList'. 'getFirst()' member of List is redundant in Kotlin and might be removed soon. Please use 'first()' stdlib extension instead
|
/newListMethods.kt:54:7: warning: 'getFirst(): E!' is deprecated. Overrides deprecated member in 'java.util.AbstractList'. 'getFirst()' member of List is redundant in Kotlin and might be removed soon. Please use 'first()' stdlib extension instead
|
||||||
z.getFirst()
|
z.getFirst()
|
||||||
^^^^^^^^
|
^^^^^^^^
|
||||||
/newListMethods.kt:50:7: warning: 'getFirst(): E!' is deprecated. Overrides deprecated member in 'java.util.AbstractList'. 'getFirst()' member of List is redundant in Kotlin and might be removed soon. Please use 'first()' stdlib extension instead
|
/newListMethods.kt:55:7: warning: 'getFirst(): E!' is deprecated. Overrides deprecated member in 'java.util.AbstractList'. 'getFirst()' member of List is redundant in Kotlin and might be removed soon. Please use 'first()' stdlib extension instead
|
||||||
z.first
|
z.first
|
||||||
^^^^^
|
^^^^^
|
||||||
/newListMethods.kt:52:7: warning: 'getLast(): E!' is deprecated. Overrides deprecated member in 'java.util.AbstractList'. 'getLast()' member of List is redundant in Kotlin and might be removed soon. Please use 'last()' stdlib extension instead
|
/newListMethods.kt:57:7: warning: 'getLast(): E!' is deprecated. Overrides deprecated member in 'java.util.AbstractList'. 'getLast()' member of List is redundant in Kotlin and might be removed soon. Please use 'last()' stdlib extension instead
|
||||||
z.getLast()
|
z.getLast()
|
||||||
^^^^^^^
|
^^^^^^^
|
||||||
/newListMethods.kt:53:7: warning: 'getLast(): E!' is deprecated. Overrides deprecated member in 'java.util.AbstractList'. 'getLast()' member of List is redundant in Kotlin and might be removed soon. Please use 'last()' stdlib extension instead
|
/newListMethods.kt:58:7: warning: 'getLast(): E!' is deprecated. Overrides deprecated member in 'java.util.AbstractList'. 'getLast()' member of List is redundant in Kotlin and might be removed soon. Please use 'last()' stdlib extension instead
|
||||||
z.last
|
z.last
|
||||||
^^^^
|
^^^^
|
||||||
|
|
||||||
|
|||||||
+20
-16
@@ -1,31 +1,35 @@
|
|||||||
/newListMethods.fir.kt:(231,239): warning: This declaration overrides a deprecated member but is not marked as deprecated itself. Please add the '@Deprecated' annotation or suppress the diagnostic.
|
/newListMethods.fir.kt:(337,345): warning: This declaration overrides a deprecated member but is not marked as deprecated itself. Please add the '@Deprecated' annotation or suppress the diagnostic.
|
||||||
|
|
||||||
/newListMethods.fir.kt:(253,261): warning: 'fun getFirst(): T!' is deprecated. This declaration will be renamed in a future version of Kotlin. Please consider using the 'first()' stdlib extension if the collection supports fast random access.
|
/newListMethods.fir.kt:(359,367): warning: 'fun getFirst(): T!' is deprecated. This declaration will be renamed in a future version of Kotlin. Please consider using the 'first()' stdlib extension if the collection supports fast random access.
|
||||||
|
|
||||||
/newListMethods.fir.kt:(281,288): warning: This declaration overrides a deprecated member but is not marked as deprecated itself. Please add the '@Deprecated' annotation or suppress the diagnostic.
|
/newListMethods.fir.kt:(387,394): warning: This declaration overrides a deprecated member but is not marked as deprecated itself. Please add the '@Deprecated' annotation or suppress the diagnostic.
|
||||||
|
|
||||||
/newListMethods.fir.kt:(302,309): warning: 'fun getLast(): T!' is deprecated. This declaration will be renamed in a future version of Kotlin. Please consider using the 'last()' stdlib extension if the collection supports fast random access.
|
/newListMethods.fir.kt:(408,415): warning: 'fun getLast(): T!' is deprecated. This declaration will be renamed in a future version of Kotlin. Please consider using the 'last()' stdlib extension if the collection supports fast random access.
|
||||||
|
|
||||||
/newListMethods.fir.kt:(596,604): error: Unresolved reference 'getFirst'.
|
/newListMethods.fir.kt:(452,457): warning: 'val first: T!' is deprecated. This declaration will be renamed in a future version of Kotlin. Please consider using the 'first()' stdlib extension if the collection supports fast random access.
|
||||||
|
|
||||||
/newListMethods.fir.kt:(613,618): error: Function invocation 'first()' expected.
|
/newListMethods.fir.kt:(490,494): warning: 'val last: T!' is deprecated. This declaration will be renamed in a future version of Kotlin. Please consider using the 'last()' stdlib extension if the collection supports fast random access.
|
||||||
|
|
||||||
/newListMethods.fir.kt:(704,711): error: Unresolved reference 'getLast'.
|
/newListMethods.fir.kt:(779,787): error: Unresolved reference 'getFirst'.
|
||||||
|
|
||||||
/newListMethods.fir.kt:(720,724): error: Function invocation 'last()' expected.
|
/newListMethods.fir.kt:(796,801): error: Function invocation 'first()' expected.
|
||||||
|
|
||||||
/newListMethods.fir.kt:(838,846): warning: 'fun getFirst(): String!' is deprecated. This declaration will be renamed in a future version of Kotlin. Please consider using the 'first()' stdlib extension if the collection supports fast random access.
|
/newListMethods.fir.kt:(887,894): error: Unresolved reference 'getLast'.
|
||||||
|
|
||||||
/newListMethods.fir.kt:(855,860): warning: 'val first: String!' is deprecated. This declaration will be renamed in a future version of Kotlin. Please consider using the 'first()' stdlib extension if the collection supports fast random access.
|
/newListMethods.fir.kt:(903,907): error: Function invocation 'last()' expected.
|
||||||
|
|
||||||
/newListMethods.fir.kt:(881,888): warning: 'fun getLast(): String!' is deprecated. This declaration will be renamed in a future version of Kotlin. Please consider using the 'last()' stdlib extension if the collection supports fast random access.
|
/newListMethods.fir.kt:(1021,1029): warning: 'fun getFirst(): String!' is deprecated. This declaration will be renamed in a future version of Kotlin. Please consider using the 'first()' stdlib extension if the collection supports fast random access.
|
||||||
|
|
||||||
/newListMethods.fir.kt:(897,901): warning: 'val last: String!' is deprecated. This declaration will be renamed in a future version of Kotlin. Please consider using the 'last()' stdlib extension if the collection supports fast random access.
|
/newListMethods.fir.kt:(1038,1043): warning: 'val first: String!' is deprecated. This declaration will be renamed in a future version of Kotlin. Please consider using the 'first()' stdlib extension if the collection supports fast random access.
|
||||||
|
|
||||||
/newListMethods.fir.kt:(1015,1023): warning: 'fun getFirst(): String' is deprecated. This declaration will be renamed in a future version of Kotlin. Please consider using the 'first()' stdlib extension if the collection supports fast random access.
|
/newListMethods.fir.kt:(1064,1071): warning: 'fun getLast(): String!' is deprecated. This declaration will be renamed in a future version of Kotlin. Please consider using the 'last()' stdlib extension if the collection supports fast random access.
|
||||||
|
|
||||||
/newListMethods.fir.kt:(1032,1037): warning: 'val first: String' is deprecated. This declaration will be renamed in a future version of Kotlin. Please consider using the 'first()' stdlib extension if the collection supports fast random access.
|
/newListMethods.fir.kt:(1080,1084): warning: 'val last: String!' is deprecated. This declaration will be renamed in a future version of Kotlin. Please consider using the 'last()' stdlib extension if the collection supports fast random access.
|
||||||
|
|
||||||
/newListMethods.fir.kt:(1058,1065): warning: 'fun getLast(): String' is deprecated. This declaration will be renamed in a future version of Kotlin. Please consider using the 'last()' stdlib extension if the collection supports fast random access.
|
/newListMethods.fir.kt:(1198,1206): warning: 'fun getFirst(): String' is deprecated. This declaration will be renamed in a future version of Kotlin. Please consider using the 'first()' stdlib extension if the collection supports fast random access.
|
||||||
|
|
||||||
/newListMethods.fir.kt:(1074,1078): warning: 'val last: String' is deprecated. This declaration will be renamed in a future version of Kotlin. Please consider using the 'last()' stdlib extension if the collection supports fast random access.
|
/newListMethods.fir.kt:(1215,1220): warning: 'val first: String' is deprecated. This declaration will be renamed in a future version of Kotlin. Please consider using the 'first()' stdlib extension if the collection supports fast random access.
|
||||||
|
|
||||||
|
/newListMethods.fir.kt:(1241,1248): warning: 'fun getLast(): String' is deprecated. This declaration will be renamed in a future version of Kotlin. Please consider using the 'last()' stdlib extension if the collection supports fast random access.
|
||||||
|
|
||||||
|
/newListMethods.fir.kt:(1257,1261): warning: 'val last: String' is deprecated. This declaration will be renamed in a future version of Kotlin. Please consider using the 'last()' stdlib extension if the collection supports fast random access.
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
// ISSUE: KT-58371
|
// ISSUE: KT-58371
|
||||||
// RENDER_DIAGNOSTICS_FULL_TEXT
|
// RENDER_DIAGNOSTICS_FULL_TEXT
|
||||||
|
// DIAGNOSTICS: -SUPER_CANT_BE_EXTENSION_RECEIVER
|
||||||
|
// ^Otherwise only K1 errors are written to .diag file.
|
||||||
|
|
||||||
class A<T> : ArrayList<T>() {
|
class A<T> : ArrayList<T>() {
|
||||||
override fun addFirst(t: T) {
|
override fun addFirst(t: T) {
|
||||||
@@ -13,6 +15,9 @@ class A<T> : ArrayList<T>() {
|
|||||||
override fun <!OVERRIDE_DEPRECATION!>getFirst<!>(): T = super.<!DEPRECATION!>getFirst<!>()
|
override fun <!OVERRIDE_DEPRECATION!>getFirst<!>(): T = super.<!DEPRECATION!>getFirst<!>()
|
||||||
override fun <!OVERRIDE_DEPRECATION!>getLast<!>(): T = super.<!DEPRECATION!>getLast<!>()
|
override fun <!OVERRIDE_DEPRECATION!>getLast<!>(): T = super.<!DEPRECATION!>getLast<!>()
|
||||||
|
|
||||||
|
fun superFirst2(): T = super.<!DEPRECATION!>first<!>
|
||||||
|
fun superLast2(): T = super.<!DEPRECATION!>last<!>
|
||||||
|
|
||||||
override fun removeFirst(): T = super.removeFirst()
|
override fun removeFirst(): T = super.removeFirst()
|
||||||
override fun removeLast(): T = super.removeLast()
|
override fun removeLast(): T = super.removeLast()
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
// ISSUE: KT-58371
|
// ISSUE: KT-58371
|
||||||
// RENDER_DIAGNOSTICS_FULL_TEXT
|
// RENDER_DIAGNOSTICS_FULL_TEXT
|
||||||
|
// DIAGNOSTICS: -SUPER_CANT_BE_EXTENSION_RECEIVER
|
||||||
|
// ^Otherwise only K1 errors are written to .diag file.
|
||||||
|
|
||||||
class A<T> : ArrayList<T>() {
|
class A<T> : ArrayList<T>() {
|
||||||
override fun addFirst(t: T) {
|
override fun addFirst(t: T) {
|
||||||
@@ -13,6 +15,9 @@ class A<T> : ArrayList<T>() {
|
|||||||
override fun <!OVERRIDE_DEPRECATION!>getFirst<!>(): T = super.<!DEPRECATION!>getFirst<!>()
|
override fun <!OVERRIDE_DEPRECATION!>getFirst<!>(): T = super.<!DEPRECATION!>getFirst<!>()
|
||||||
override fun <!OVERRIDE_DEPRECATION!>getLast<!>(): T = super.<!DEPRECATION!>getLast<!>()
|
override fun <!OVERRIDE_DEPRECATION!>getLast<!>(): T = super.<!DEPRECATION!>getLast<!>()
|
||||||
|
|
||||||
|
fun superFirst2(): T = super.<!DEPRECATION!>first<!>
|
||||||
|
fun superLast2(): T = super.<!DEPRECATION!>last<!>
|
||||||
|
|
||||||
override fun removeFirst(): T = super.removeFirst()
|
override fun removeFirst(): T = super.removeFirst()
|
||||||
override fun removeLast(): T = super.removeLast()
|
override fun removeLast(): T = super.removeLast()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user