varargs
* generate VARARGS flag in FunctionCodegen * test in CompileJavaAgainstKotlinTest
This commit is contained in:
@@ -61,6 +61,13 @@ public class FunctionCodegen {
|
|||||||
List<TypeParameterDescriptor> typeParameters = (functionDescriptor instanceof PropertyAccessorDescriptor ? ((PropertyAccessorDescriptor)functionDescriptor).getCorrespondingProperty(): functionDescriptor).getTypeParameters();
|
List<TypeParameterDescriptor> typeParameters = (functionDescriptor instanceof PropertyAccessorDescriptor ? ((PropertyAccessorDescriptor)functionDescriptor).getCorrespondingProperty(): functionDescriptor).getTypeParameters();
|
||||||
|
|
||||||
int flags = ACC_PUBLIC; // TODO.
|
int flags = ACC_PUBLIC; // TODO.
|
||||||
|
|
||||||
|
if (!functionDescriptor.getValueParameters().isEmpty()
|
||||||
|
&& functionDescriptor.getValueParameters().get(functionDescriptor.getValueParameters().size() - 1)
|
||||||
|
.getVarargElementType() != null)
|
||||||
|
{
|
||||||
|
flags |= ACC_VARARGS;
|
||||||
|
}
|
||||||
|
|
||||||
OwnerKind kind = context.getContextKind();
|
OwnerKind kind = context.getContextKind();
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import java.util.List;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
class Vararg {
|
||||||
|
{
|
||||||
|
List<String> list = new ArrayList<String>();
|
||||||
|
List<String> r = namespace.gg(list, 3, 4, 5, 6);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
fun gg(list: List<String>, vararg ints: Int) = list
|
||||||
Reference in New Issue
Block a user