< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java

Print this page
*** 1,7 ***
  /*
!  * Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.  Oracle designates this
--- 1,7 ---
  /*
!  * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.  Oracle designates this

*** 832,11 ***
  
              @Override
              public void visitLambda(JCLambda tree) {
                  Check.CheckContext checkContext = resultInfo.checkContext;
                  Type pt = resultInfo.pt;
!                 if (!inferenceContext.inferencevars.contains(pt)) {
                      //must be a functional descriptor
                      Type descriptorType = null;
                      try {
                          descriptorType = types.findDescriptorType(pt);
                      } catch (Types.FunctionDescriptorLookupError ex) {
--- 832,11 ---
  
              @Override
              public void visitLambda(JCLambda tree) {
                  Check.CheckContext checkContext = resultInfo.checkContext;
                  Type pt = resultInfo.pt;
!                 if (!types.isQuoted(pt) && !inferenceContext.inferencevars.contains(pt)) {
                      //must be a functional descriptor
                      Type descriptorType = null;
                      try {
                          descriptorType = types.findDescriptorType(pt);
                      } catch (Types.FunctionDescriptorLookupError ex) {

*** 1224,11 ***
          @Override
          public void visitLambda(JCLambda tree) {
              if (inferenceContext.inferenceVars().contains(pt)) {
                  stuckVars.add(pt);
              }
!             if (!types.isFunctionalInterface(pt)) {
                  return;
              }
              Type descType = types.findDescriptorType(pt);
              List<Type> freeArgVars = inferenceContext.freeVarsIn(descType.getParameterTypes());
              if (tree.paramKind == JCLambda.ParameterKind.IMPLICIT &&
--- 1224,11 ---
          @Override
          public void visitLambda(JCLambda tree) {
              if (inferenceContext.inferenceVars().contains(pt)) {
                  stuckVars.add(pt);
              }
!             if (types.isQuoted(pt) || !types.isFunctionalInterface(pt)) {
                  return;
              }
              Type descType = types.findDescriptorType(pt);
              List<Type> freeArgVars = inferenceContext.freeVarsIn(descType.getParameterTypes());
              if (tree.paramKind == JCLambda.ParameterKind.IMPLICIT &&
< prev index next >