FIR2IR: generate annotations on fake override parameters #KT-53208 Fixed
This commit is contained in:
+6
-1
@@ -556,12 +556,12 @@ class Fir2IrDeclarationStorage(
|
||||
containerSource = simpleFunction?.containerSource,
|
||||
).apply {
|
||||
metadata = FirMetadataSource.Function(function)
|
||||
convertAnnotationsForNonDeclaredMembers(function, origin)
|
||||
enterScope(this)
|
||||
bindAndDeclareParameters(
|
||||
function, irParent,
|
||||
thisReceiverOwner, isStatic = simpleFunction?.isStatic == true
|
||||
)
|
||||
convertAnnotationsForNonDeclaredMembers(function, origin)
|
||||
leaveScope(this)
|
||||
}
|
||||
}
|
||||
@@ -1595,6 +1595,11 @@ class Fir2IrDeclarationStorage(
|
||||
|| origin == IrDeclarationOrigin.FAKE_OVERRIDE
|
||||
) {
|
||||
annotationGenerator.generate(this, firAnnotationContainer)
|
||||
if (this is IrFunction && firAnnotationContainer is FirSimpleFunction) {
|
||||
valueParameters.zip(firAnnotationContainer.valueParameters).forEach { (irParameter, firParameter) ->
|
||||
annotationGenerator.generate(irParameter, firParameter, isInConstructor = false)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+6
@@ -17817,6 +17817,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/fir/falsePositiveBoundSmartcast.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("findAnnotationOnDefaultMethodParameter.kt")
|
||||
public void testFindAnnotationOnDefaultMethodParameter() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fir/findAnnotationOnDefaultMethodParameter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("Fir2IrClassifierStorage.kt")
|
||||
public void testFir2IrClassifierStorage() throws Exception {
|
||||
|
||||
Generated
+6
@@ -2632,6 +2632,12 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest {
|
||||
runTest("compiler/testData/ir/irText/firProblems/recursiveCapturedTypeInPropertyReference.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("reflectFindAnnotationOnDefaultMethodParameter.kt")
|
||||
public void testReflectFindAnnotationOnDefaultMethodParameter() throws Exception {
|
||||
runTest("compiler/testData/ir/irText/firProblems/reflectFindAnnotationOnDefaultMethodParameter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("reflectGetOnNullableTypeAlias.kt")
|
||||
public void testReflectGetOnNullableTypeAlias() throws Exception {
|
||||
|
||||
+6
@@ -2632,6 +2632,12 @@ public class LightTreeFir2IrTextTestGenerated extends AbstractLightTreeFir2IrTex
|
||||
runTest("compiler/testData/ir/irText/firProblems/recursiveCapturedTypeInPropertyReference.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("reflectFindAnnotationOnDefaultMethodParameter.kt")
|
||||
public void testReflectFindAnnotationOnDefaultMethodParameter() throws Exception {
|
||||
runTest("compiler/testData/ir/irText/firProblems/reflectFindAnnotationOnDefaultMethodParameter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("reflectGetOnNullableTypeAlias.kt")
|
||||
public void testReflectGetOnNullableTypeAlias() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user