Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8171321

NPE in Types.skipTypeVars

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Cannot Reproduce
    • Affects Version/s: 9
    • Fix Version/s: 10
    • Component/s: tools
    • Labels:

      Description

      The following program crashes javac 9-ea+149:

      ===
      import java.util.function.Function;

      abstract class Test {
        interface A<E> { boolean f(); }
        abstract <R, T> void g(Function<R, T> extractorFunction);
        void h() {
          g((A::f));
        }
      }
      ===

      java.lang.NullPointerException
              at jdk.compiler/com.sun.tools.javac.code.Types.skipTypeVars(Types.java:182)
              at jdk.compiler/com.sun.tools.javac.comp.Resolve$UnboundMethodReferenceLookupHelper.<init>(Resolve.java:3235)
              at jdk.compiler/com.sun.tools.javac.comp.Resolve$MethodReferenceLookupHelper.unboundLookup(Resolve.java:3182)
              at jdk.compiler/com.sun.tools.javac.comp.Resolve.resolveMemberReference(Resolve.java:2790)
              at jdk.compiler/com.sun.tools.javac.comp.Attr.visitReference(Attr.java:2887)
              at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMemberReference.accept(JCTree.java:2184)
              at jdk.compiler/com.sun.tools.javac.comp.Attr$ResultInfo.attr(Attr.java:501)
              at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:639)
              at jdk.compiler/com.sun.tools.javac.comp.Attr.visitParens(Attr.java:3150)
              at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCParens.accept(JCTree.java:1841)
              at jdk.compiler/com.sun.tools.javac.comp.Attr$ResultInfo.attr(Attr.java:501)
              at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:639)
              at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr$4.complete(DeferredAttr.java:340)
              at jdk.compiler/com.sun.tools.javac.comp.ArgumentAttr$ArgumentType.complete(ArgumentAttr.java:362)
              at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr$DeferredType.check(DeferredAttr.java:301)
              at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr$DeferredType.check(DeferredAttr.java:287)
              at jdk.compiler/com.sun.tools.javac.comp.Resolve$MethodResultInfo.check(Resolve.java:1036)
              at jdk.compiler/com.sun.tools.javac.comp.Resolve$4.checkArg(Resolve.java:859)
              at jdk.compiler/com.sun.tools.javac.comp.Resolve$AbstractMethodCheck.argumentsAcceptable(Resolve.java:759)
              at jdk.compiler/com.sun.tools.javac.comp.Resolve$4.argumentsAcceptable(Resolve.java:868)
              at jdk.compiler/com.sun.tools.javac.comp.Infer.instantiateMethod(Infer.java:188)
              at jdk.compiler/com.sun.tools.javac.comp.Resolve.rawInstantiate(Resolve.java:589)
              at jdk.compiler/com.sun.tools.javac.comp.Resolve.checkMethod(Resolve.java:628)
              at jdk.compiler/com.sun.tools.javac.comp.Attr.checkMethod(Attr.java:3973)

        Attachments

          Activity

            People

            Assignee:
            sadayapalam Srikanth Adayapalam
            Reporter:
            cushon Liam Miller-Cushon
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: