Example #1
0
 /*lambda or callable reference*/
 public static boolean isInliningParameter(
     JetExpression expression, ValueParameterDescriptor valueParameterDescriptor) {
   // TODO deparenthisise typed
   JetExpression deparenthesized = JetPsiUtil.deparenthesize(expression);
   return InlineUtil.isInlineLambdaParameter(valueParameterDescriptor)
       && isInlinableParameterExpression(deparenthesized);
 }
Example #2
0
  public void rememberClosure(JetExpression expression, Type type) {
    JetExpression lambda = JetPsiUtil.deparenthesize(expression);
    assert isInlinableParameterExpression(lambda)
        : "Couldn't find inline expression in " + expression.getText();

    LambdaInfo info = new LambdaInfo(lambda, typeMapper);

    ParameterInfo closureInfo = invocationParamBuilder.addNextParameter(type, true, null);
    closureInfo.setLambda(info);
    expressionMap.put(closureInfo.getIndex(), info);
  }