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

Stack overflow when computing upward projection of an intersection type with fbounds

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 10
    • 10
    • tools
    • None
    • b29

      Try to compile following code

      interface Selector<E extends Enum<E> & Selector<E>> {}
          public void test2(){

              Map<String, Selector<?>> selectorMap = new HashMap<>();
              var sel = selectorMap.get("");
          }



      The system is out of resources.
      Consult the following stack trace for details.
      java.lang.StackOverflowError
      at jdk.compiler/com.sun.tools.javac.code.Types$UnaryVisitor.visit(Types.java:4945)
      at jdk.compiler/com.sun.tools.javac.code.Types.directSupertypes(Types.java:2592)
      at jdk.compiler/com.sun.tools.javac.code.Types$TypeProjection.visitClassType(Types.java:252)
      at jdk.compiler/com.sun.tools.javac.code.Types$TypeProjection.visitClassType(Types.java:240)
      at jdk.compiler/com.sun.tools.javac.code.Type$ClassType.accept(Type.java:992)
      at jdk.compiler/com.sun.tools.javac.code.Types$DefaultTypeVisitor.visit(Types.java:4865)
      at jdk.compiler/com.sun.tools.javac.code.Type.map(Type.java:304)
      at jdk.compiler/com.sun.tools.javac.code.Types$TypeProjection.visitTypeVar(Types.java:311)
      at jdk.compiler/com.sun.tools.javac.code.Types$TypeProjection.visitTypeVar(Types.java:240)
      at jdk.compiler/com.sun.tools.javac.code.Types$TypeMapping.visitCapturedType(Types.java:4978)
      at jdk.compiler/com.sun.tools.javac.code.Types$TypeMapping.visitCapturedType(Types.java:4968)
      at jdk.compiler/com.sun.tools.javac.code.Type$CapturedType.accept(Type.java:1734)
      at jdk.compiler/com.sun.tools.javac.code.Types$DefaultTypeVisitor.visit(Types.java:4865)
      at jdk.compiler/com.sun.tools.javac.code.Type.map(Type.java:304)

            mcimadamore Maurizio Cimadamore
            anazarov Andrey Nazarov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: