FIR: Make replace function accepting parameter with nullability as-is
This commit is contained in:
@@ -42,7 +42,7 @@ abstract class FirAnonymousFunction : FirPureAbstractElement(), FirFunction<FirA
|
|||||||
|
|
||||||
override fun <R, D> accept(visitor: FirVisitor<R, D>, data: D): R = visitor.visitAnonymousFunction(this, data)
|
override fun <R, D> accept(visitor: FirVisitor<R, D>, data: D): R = visitor.visitAnonymousFunction(this, data)
|
||||||
|
|
||||||
abstract fun replaceInvocationKind(newInvocationKind: InvocationKind)
|
abstract fun replaceInvocationKind(newInvocationKind: InvocationKind?)
|
||||||
|
|
||||||
abstract override fun <D> transformReturnTypeRef(transformer: FirTransformer<D>, data: D): FirAnonymousFunction
|
abstract override fun <D> transformReturnTypeRef(transformer: FirTransformer<D>, data: D): FirAnonymousFunction
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -107,7 +107,7 @@ class FirAnonymousFunctionImpl(
|
|||||||
typeRef = newTypeRef
|
typeRef = newTypeRef
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun replaceInvocationKind(newInvocationKind: InvocationKind) {
|
override fun replaceInvocationKind(newInvocationKind: InvocationKind?) {
|
||||||
invocationKind = newInvocationKind
|
invocationKind = newInvocationKind
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,5 +21,5 @@ abstract class FirThisReference : FirReference() {
|
|||||||
|
|
||||||
override fun <R, D> accept(visitor: FirVisitor<R, D>, data: D): R = visitor.visitThisReference(this, data)
|
override fun <R, D> accept(visitor: FirVisitor<R, D>, data: D): R = visitor.visitThisReference(this, data)
|
||||||
|
|
||||||
abstract fun replaceBoundSymbol(newBoundSymbol: AbstractFirBasedSymbol<*>)
|
abstract fun replaceBoundSymbol(newBoundSymbol: AbstractFirBasedSymbol<*>?)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -27,7 +27,7 @@ class FirExplicitThisReference(
|
|||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun replaceBoundSymbol(newBoundSymbol: AbstractFirBasedSymbol<*>) {
|
override fun replaceBoundSymbol(newBoundSymbol: AbstractFirBasedSymbol<*>?) {
|
||||||
boundSymbol = newBoundSymbol
|
boundSymbol = newBoundSymbol
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -27,5 +27,5 @@ class FirImplicitThisReference(
|
|||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun replaceBoundSymbol(newBoundSymbol: AbstractFirBasedSymbol<*>) {}
|
override fun replaceBoundSymbol(newBoundSymbol: AbstractFirBasedSymbol<*>?) {}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-4
@@ -67,7 +67,7 @@ fun transformFunctionDeclaration(transformName: String, returnType: String): Str
|
|||||||
|
|
||||||
fun Field.replaceFunctionDeclaration(): String {
|
fun Field.replaceFunctionDeclaration(): String {
|
||||||
val capName = name.capitalize()
|
val capName = name.capitalize()
|
||||||
return "fun replace$capName(new$capName: $typeWithArgumentsWithoutNullablity)"
|
return "fun replace$capName(new$capName: $typeWithArguments)"
|
||||||
}
|
}
|
||||||
|
|
||||||
val Field.mutableType: String
|
val Field.mutableType: String
|
||||||
@@ -107,8 +107,6 @@ val Importable.typeWithArguments: String
|
|||||||
else -> throw IllegalArgumentException()
|
else -> throw IllegalArgumentException()
|
||||||
}
|
}
|
||||||
|
|
||||||
val Importable.typeWithArgumentsWithoutNullablity: String get() = typeWithArguments.dropLastWhile { it == '?' }
|
|
||||||
|
|
||||||
val ImplementationWithArg.generics: String
|
val ImplementationWithArg.generics: String
|
||||||
get() = argument?.let { "<${it.type}>" } ?: ""
|
get() = argument?.let { "<${it.type}>" } ?: ""
|
||||||
|
|
||||||
@@ -128,4 +126,4 @@ val Element.typeParameters: String
|
|||||||
?: ""
|
?: ""
|
||||||
|
|
||||||
val Type.generics: String
|
val Type.generics: String
|
||||||
get() = arguments.takeIf { it.isNotEmpty() }?.joinToString(",", "<", ">") ?: ""
|
get() = arguments.takeIf { it.isNotEmpty() }?.joinToString(",", "<", ">") ?: ""
|
||||||
|
|||||||
Reference in New Issue
Block a user