Java 类com.sun.tools.javac.tree.JCTree.JCLambda.ParameterKind 实例源码

项目:openjdk-jdk10    文件:ArgumentAttr.java   
@Override
public void visitLambda(JCLambda that) {
    if (that.paramKind == ParameterKind.EXPLICIT) {
        //if lambda is explicit, we can save info in the corresponding argument type
        processArg(that, () -> {
            JCLambda speculativeLambda =
                    deferredAttr.attribSpeculativeLambda(that, env, attr.methodAttrInfo);
            return new ExplicitLambdaType(that, env, speculativeLambda);
        });
    } else {
        //otherwise just use a deferred type
        setResult(that, deferredAttr.new DeferredType(that, env));
    }
}
项目:openjdk-jdk10    文件:Analyzer.java   
@Override @DefinedBy(Api.COMPILER_TREE)
public JCTree visitLambdaExpression(LambdaExpressionTree node, Void _unused) {
    JCLambda oldLambda = (JCLambda)node;
    JCLambda newLambda = (JCLambda)super.visitLambdaExpression(node, _unused);
    if (oldLambda.paramKind == ParameterKind.IMPLICIT) {
        //reset implicit lambda parameters (whose type might have been set during attr)
        newLambda.paramKind = ParameterKind.IMPLICIT;
        newLambda.params.forEach(p -> p.vartype = null);
    }
    return newLambda;
}
项目:openjdk9    文件:ArgumentAttr.java   
@Override
public void visitLambda(JCLambda that) {
    if (that.paramKind == ParameterKind.EXPLICIT) {
        //if lambda is explicit, we can save info in the corresponding argument type
        processArg(that, () -> {
            JCLambda speculativeLambda =
                    deferredAttr.attribSpeculativeLambda(that, env, attr.methodAttrInfo);
            return new ExplicitLambdaType(that, env, speculativeLambda);
        });
    } else {
        //otherwise just use a deferred type
        setResult(that, deferredAttr.new DeferredType(that, env));
    }
}
项目:openjdk9    文件:Analyzer.java   
@Override @DefinedBy(Api.COMPILER_TREE)
public JCTree visitLambdaExpression(LambdaExpressionTree node, Void _unused) {
    JCLambda oldLambda = (JCLambda)node;
    JCLambda newLambda = (JCLambda)super.visitLambdaExpression(node, _unused);
    if (oldLambda.paramKind == ParameterKind.IMPLICIT) {
        //reset implicit lambda parameters (whose type might have been set during attr)
        newLambda.paramKind = ParameterKind.IMPLICIT;
        newLambda.params.forEach(p -> p.vartype = null);
    }
    return newLambda;
}
项目:error-prone    文件:ULambda.java   
public List<JCVariableDecl> inlineParams(Inliner inliner) throws CouldNotResolveImportException {
  if (parameterKind() == ParameterKind.EXPLICIT) {
    return List.convert(JCVariableDecl.class, inliner.inlineList(getParameters()));
  }
  ListBuffer<JCVariableDecl> params = new ListBuffer<>();
  for (UVariableDecl param : getParameters()) {
    params.add(param.inlineImplicitType(inliner));
  }
  return params.toList();
}
项目:error-prone    文件:ULambda.java   
public static ULambda create(
    ParameterKind parameterKind, Iterable<UVariableDecl> parameters, UTree<?> body) {
  return new AutoValue_ULambda(parameterKind, ImmutableList.copyOf(parameters), body);
}
项目:error-prone    文件:ULambda.java   
abstract ParameterKind parameterKind();