提交 6bee7771 编写于 作者: S Stepan Koltsov

reading functions with default args

上级 6830adc3
......@@ -608,6 +608,7 @@ public class JavaDescriptorResolver {
String typeFromAnnotation = null;
boolean receiver = false;
boolean hasDefaultValue = false;
// TODO: must be very slow, make it lazy?
String name = parameter.getName() != null ? parameter.getName() : "p" + i;
......@@ -638,6 +639,11 @@ public class JavaDescriptorResolver {
if (receiverExpression != null) {
receiver = (Boolean) receiverExpression.getValue();
}
PsiLiteralExpression hasDefaultValueExpression = (PsiLiteralExpression) annotation.findAttributeValue(StdlibNames.JET_VALUE_PARAMETER_HAS_DEFAULT_VALUE_FIELD);
if (hasDefaultValueExpression != null) {
hasDefaultValue = (Boolean) hasDefaultValueExpression.getValue();
}
} else if (annotation.getQualifiedName().equals(StdlibNames.JET_TYPE_PARAMETER.getFqName())) {
......@@ -661,7 +667,7 @@ public class JavaDescriptorResolver {
name,
null, // TODO : review
changeNullable ? TypeUtils.makeNullableAsSpecified(outType, nullable) : outType,
false,
hasDefaultValue,
varargElementType
));
}
......
namespace test
fun funDefaultArg(p: Int, q: Int = 17, r: Int = 18) = 19
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册