Fix some compiler warnings in FIR modules
This commit is contained in:
@@ -159,14 +159,14 @@ internal class FirJavaClassBuilder : FirRegularClassBuilder(), FirAnnotationCont
|
||||
@Deprecated("Modification of 'hasLazyNestedClassifiers' has no impact for FirRegularClassImplBuilder", level = DeprecationLevel.HIDDEN)
|
||||
override var companionObject: FirRegularClass?
|
||||
get() = throw IllegalStateException()
|
||||
set(value) {
|
||||
set(@Suppress("UNUSED_PARAMETER") value) {
|
||||
throw IllegalStateException()
|
||||
}
|
||||
|
||||
@Deprecated("Modification of 'origin' has no impact for FirJavaClassBuilder", level = DeprecationLevel.HIDDEN)
|
||||
override var origin: FirDeclarationOrigin
|
||||
get() = throw IllegalStateException()
|
||||
set(value) {
|
||||
set(@Suppress("UNUSED_PARAMETER") value) {
|
||||
throw IllegalStateException()
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -157,35 +157,35 @@ class FirJavaConstructorBuilder : FirConstructorBuilder() {
|
||||
@Deprecated("Modification of 'body' has no impact for FirJavaConstructorBuilder", level = DeprecationLevel.HIDDEN)
|
||||
override var body: FirBlock?
|
||||
get() = throw IllegalStateException()
|
||||
set(value) {
|
||||
set(@Suppress("UNUSED_PARAMETER") value) {
|
||||
throw IllegalStateException()
|
||||
}
|
||||
|
||||
@Deprecated("Modification of 'delegatedConstructor' has no impact for FirJavaConstructorBuilder", level = DeprecationLevel.HIDDEN)
|
||||
override var delegatedConstructor: FirDelegatedConstructorCall?
|
||||
get() = throw IllegalStateException()
|
||||
set(value) {
|
||||
set(@Suppress("UNUSED_PARAMETER") value) {
|
||||
throw IllegalStateException()
|
||||
}
|
||||
|
||||
@Deprecated("Modification of 'resolvePhase' has no impact for FirJavaConstructorBuilder", level = DeprecationLevel.HIDDEN)
|
||||
override var resolvePhase: FirResolvePhase
|
||||
get() = throw IllegalStateException()
|
||||
set(value) {
|
||||
set(@Suppress("UNUSED_PARAMETER") value) {
|
||||
throw IllegalStateException()
|
||||
}
|
||||
|
||||
@Deprecated("Modification of 'receiverTypeRef' has no impact for FirJavaConstructorBuilder", level = DeprecationLevel.HIDDEN)
|
||||
override var receiverTypeRef: FirTypeRef?
|
||||
get() = throw IllegalStateException()
|
||||
set(value) {
|
||||
set(@Suppress("UNUSED_PARAMETER") value) {
|
||||
throw IllegalStateException()
|
||||
}
|
||||
|
||||
@Deprecated("Modification of 'origin' has no impact for FirJavaConstructorBuilder", level = DeprecationLevel.HIDDEN)
|
||||
override var origin: FirDeclarationOrigin
|
||||
get() = throw IllegalStateException()
|
||||
set(value) {
|
||||
set(@Suppress("UNUSED_PARAMETER") value) {
|
||||
throw IllegalStateException()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
package org.jetbrains.kotlin.fir.java.declarations
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.ClassKind
|
||||
import org.jetbrains.kotlin.descriptors.Modality
|
||||
import org.jetbrains.kotlin.descriptors.Visibility
|
||||
import org.jetbrains.kotlin.fir.FirImplementationDetail
|
||||
@@ -14,8 +13,6 @@ import org.jetbrains.kotlin.fir.FirSourceElement
|
||||
import org.jetbrains.kotlin.fir.builder.FirBuilderDsl
|
||||
import org.jetbrains.kotlin.fir.declarations.*
|
||||
import org.jetbrains.kotlin.fir.declarations.builder.FirFieldBuilder
|
||||
import org.jetbrains.kotlin.fir.declarations.impl.FirDeclarationStatusImpl
|
||||
import org.jetbrains.kotlin.fir.declarations.impl.FirResolvedDeclarationStatusImpl
|
||||
import org.jetbrains.kotlin.fir.expressions.FirAnnotationCall
|
||||
import org.jetbrains.kotlin.fir.expressions.FirExpression
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirDelegateFieldSymbol
|
||||
@@ -166,7 +163,7 @@ internal class FirJavaFieldBuilder : FirFieldBuilder() {
|
||||
@Deprecated("Modification of 'origin' has no impact for FirJavaFieldBuilder", level = DeprecationLevel.HIDDEN)
|
||||
override var origin: FirDeclarationOrigin
|
||||
get() = throw IllegalStateException()
|
||||
set(value) {
|
||||
set(@Suppress("UNUSED_PARAMETER") value) {
|
||||
throw IllegalStateException()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ class FirJavaMethodBuilder : FirSimpleFunctionBuilder() {
|
||||
@Deprecated("Modification of 'origin' has no impact for FirJavaFunctionBuilder", level = DeprecationLevel.HIDDEN)
|
||||
override var origin: FirDeclarationOrigin
|
||||
get() = throw IllegalStateException()
|
||||
set(value) {
|
||||
set(@Suppress("UNUSED_PARAMETER") value) {
|
||||
throw IllegalStateException()
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -70,35 +70,35 @@ class FirJavaValueParameterBuilder : FirValueParameterBuilder() {
|
||||
@Deprecated("Modification of 'resolvePhase' has no impact for FirJavaValueParameterBuilder", level = DeprecationLevel.HIDDEN)
|
||||
override var resolvePhase: FirResolvePhase
|
||||
get() = throw IllegalStateException()
|
||||
set(value) {
|
||||
set(@Suppress("UNUSED_PARAMETER") value) {
|
||||
throw IllegalStateException()
|
||||
}
|
||||
|
||||
@Deprecated("Modification of '' has no impact for FirJavaValueParameterBuilder", level = DeprecationLevel.HIDDEN)
|
||||
override var symbol: FirVariableSymbol<FirValueParameter>
|
||||
get() = throw IllegalStateException()
|
||||
set(value) {
|
||||
set(@Suppress("UNUSED_PARAMETER") value) {
|
||||
throw IllegalStateException()
|
||||
}
|
||||
|
||||
@Deprecated("Modification of 'isCrossinline' has no impact for FirJavaValueParameterBuilder", level = DeprecationLevel.HIDDEN)
|
||||
override var isCrossinline: Boolean
|
||||
get() = throw IllegalStateException()
|
||||
set(value) {
|
||||
set(@Suppress("UNUSED_PARAMETER") value) {
|
||||
throw IllegalStateException()
|
||||
}
|
||||
|
||||
@Deprecated("Modification of 'isNoinline' has no impact for FirJavaValueParameterBuilder", level = DeprecationLevel.HIDDEN)
|
||||
override var isNoinline: Boolean
|
||||
get() = throw IllegalStateException()
|
||||
set(value) {
|
||||
set(@Suppress("UNUSED_PARAMETER") value) {
|
||||
throw IllegalStateException()
|
||||
}
|
||||
|
||||
@Deprecated("Modification of 'origin' has no impact for FirJavaValueParameterBuilder", level = DeprecationLevel.HIDDEN)
|
||||
override var origin: FirDeclarationOrigin
|
||||
get() = throw IllegalStateException()
|
||||
set(value) {
|
||||
set(@Suppress("UNUSED_PARAMETER") value) {
|
||||
throw IllegalStateException()
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -169,7 +169,7 @@ class KotlinDeserializedJvmSymbolsProvider(
|
||||
return JvmProtoBufUtil.readClassDataFrom(data, strings)
|
||||
}
|
||||
|
||||
private fun ConeClassLikeLookupTag.toDefaultResolvedTypeRef(classId: ClassId): FirResolvedTypeRef =
|
||||
private fun ConeClassLikeLookupTag.toDefaultResolvedTypeRef(): FirResolvedTypeRef =
|
||||
buildResolvedTypeRef {
|
||||
type = constructClassType(emptyArray(), isNullable = false)
|
||||
}
|
||||
@@ -191,7 +191,7 @@ class KotlinDeserializedJvmSymbolsProvider(
|
||||
private fun ClassLiteralValue.toFirClassReferenceExpression(): FirClassReferenceExpression {
|
||||
val literalLookupTag = ConeClassLikeLookupTagImpl(classId)
|
||||
return buildClassReferenceExpression {
|
||||
classTypeRef = literalLookupTag.toDefaultResolvedTypeRef(classId)
|
||||
classTypeRef = literalLookupTag.toDefaultResolvedTypeRef()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -274,7 +274,7 @@ class KotlinDeserializedJvmSymbolsProvider(
|
||||
|
||||
override fun visitEnd() {
|
||||
result += buildAnnotationCall {
|
||||
annotationTypeRef = lookupTag.toDefaultResolvedTypeRef(annotationClassId)
|
||||
annotationTypeRef = lookupTag.toDefaultResolvedTypeRef()
|
||||
argumentList = buildArgumentList {
|
||||
for ((name, expression) in argumentMap) {
|
||||
arguments += buildNamedArgumentExpression {
|
||||
|
||||
@@ -21,7 +21,6 @@ import org.jetbrains.kotlin.fir.symbols.ConeClassLikeLookupTag
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeClassifierLookupTag
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeTypeParameterLookupTag
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.ConeClassLikeLookupTagImpl
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol
|
||||
import org.jetbrains.kotlin.fir.typeContext
|
||||
import org.jetbrains.kotlin.fir.types.*
|
||||
import org.jetbrains.kotlin.fir.types.builder.buildResolvedTypeRef
|
||||
@@ -172,7 +171,7 @@ private fun ConeKotlinType.enhanceInflexibleType(
|
||||
typeArguments
|
||||
} else {
|
||||
var globalArgIndex = index + 1
|
||||
typeArguments.mapIndexed { localArgIndex, arg ->
|
||||
typeArguments.map { arg ->
|
||||
if (arg.kind != ProjectionKind.INVARIANT) {
|
||||
globalArgIndex++
|
||||
arg
|
||||
@@ -277,7 +276,7 @@ internal fun ConeKotlinType.lexicalCastFrom(session: FirSession, value: String):
|
||||
buildQualifiedAccessExpression {
|
||||
calleeReference = buildResolvedNamedReference {
|
||||
this.name = name
|
||||
resolvedSymbol = firStaticProperty.symbol as FirCallableSymbol<*>
|
||||
resolvedSymbol = firStaticProperty.symbol
|
||||
}
|
||||
}
|
||||
} else null
|
||||
|
||||
Reference in New Issue
Block a user