[FIR] Use Throwable as expected type for throw expressions
#KT-58533 Fixed
This commit is contained in:
committed by
Space Team
parent
55632f5df2
commit
7a9c516f68
@@ -32,4 +32,6 @@ abstract class FirThrowExpression : FirExpression() {
|
||||
abstract override fun replaceAnnotations(newAnnotations: List<FirAnnotation>)
|
||||
|
||||
abstract override fun <D> transformAnnotations(transformer: FirTransformer<D>, data: D): FirThrowExpression
|
||||
|
||||
abstract fun <D> transformException(transformer: FirTransformer<D>, data: D): FirThrowExpression
|
||||
}
|
||||
|
||||
+6
-1
@@ -40,7 +40,7 @@ internal class FirThrowExpressionImpl(
|
||||
override fun <D> transformChildren(transformer: FirTransformer<D>, data: D): FirThrowExpressionImpl {
|
||||
typeRef = typeRef.transform(transformer, data)
|
||||
transformAnnotations(transformer, data)
|
||||
exception = exception.transform(transformer, data)
|
||||
transformException(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
@@ -49,6 +49,11 @@ internal class FirThrowExpressionImpl(
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformException(transformer: FirTransformer<D>, data: D): FirThrowExpressionImpl {
|
||||
exception = exception.transform(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun replaceTypeRef(newTypeRef: FirTypeRef) {
|
||||
typeRef = newTypeRef
|
||||
}
|
||||
|
||||
+1
-1
@@ -620,7 +620,7 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
|
||||
}
|
||||
|
||||
throwExpression.configure {
|
||||
+field("exception", expression)
|
||||
+field("exception", expression).withTransform()
|
||||
}
|
||||
|
||||
variableAssignment.configure {
|
||||
|
||||
Reference in New Issue
Block a user