correctly calculate the number of mask arguments required for a method with default arguments
#KT-6816 Fixed
This commit is contained in:
@@ -708,7 +708,7 @@ public class JetTypeMapper {
|
|||||||
@NotNull
|
@NotNull
|
||||||
public static String getDefaultDescriptor(@NotNull Method method, boolean isExtension) {
|
public static String getDefaultDescriptor(@NotNull Method method, boolean isExtension) {
|
||||||
String descriptor = method.getDescriptor();
|
String descriptor = method.getDescriptor();
|
||||||
int argumentsCount = (Type.getArgumentsAndReturnSizes(descriptor) >> 2) - 1;
|
int argumentsCount = Type.getArgumentTypes(descriptor).length;
|
||||||
if (isExtension) {
|
if (isExtension) {
|
||||||
argumentsCount--;
|
argumentsCount--;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
public class CalculatorConstants(
|
||||||
|
val id: Long = 0,
|
||||||
|
val detour: Double = 0.0,
|
||||||
|
val taxi: Double = 0.0,
|
||||||
|
val loop: Double = 0.0,
|
||||||
|
val planeCondition: Double = 0.0,
|
||||||
|
val co2PerKerosene: Double = 0.0,
|
||||||
|
val freight: Double = 0.0,
|
||||||
|
val rfi: Double = 0.0,
|
||||||
|
val rfiAltitude: Double = 0.0,
|
||||||
|
val averageContribution: Double = 0.0,
|
||||||
|
val singleContribution: Double = 0.0,
|
||||||
|
val returnContribution: Double = 0.0,
|
||||||
|
val defraFactor: Double = 0.0,
|
||||||
|
val airCondMult: Double = 0.0,
|
||||||
|
val autoTransMult: Double = 0.0,
|
||||||
|
val hybridDefault: String? = null,
|
||||||
|
val travelClassOne: Double = 0.0,
|
||||||
|
val status: String = "OK"
|
||||||
|
)
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
val c = CalculatorConstants()
|
||||||
|
return c.status
|
||||||
|
}
|
||||||
+6
@@ -1451,6 +1451,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt6816.kt")
|
||||||
|
public void testKt6816() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/classes/kt6816.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kt707.kt")
|
@TestMetadata("kt707.kt")
|
||||||
public void testKt707() throws Exception {
|
public void testKt707() throws Exception {
|
||||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/classes/kt707.kt");
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/classes/kt707.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user