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

very long error messages on inference error

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 8
    • 8, 8-repo-lambda
    • tools
    • b100
    • Verified

    Description

      The following program:

      import java.util.*;

      class InferenceTest {
          void test(Class<? extends Foo<?, ?>> cls) {
              Foo<?, ?> foo = make(cls);
          }

          // helper used to capture wildcards as type variables
          <A, B, C extends Foo<A, B>> Foo<A, B> make(Class<C> cls) { return null; }

          interface Foo<A, B> {}
      }


      Generates a very long error message (as inference engine goes in a loop):

      javac Test.java
      Test.java:325: error: method make in class InferenceTest cannot be applied to given types;
              Foo<?, ?> foo = make(cls);
                              ^
        required: Class<C>
        found: Class<CAP#1>
        reason: inferred type does not conform to equality constraint(s)
          inferred: CAP#2
          equality constraints(s): CAP#2,CAP#3,CAP#4,CAP#5,CAP#6,CAP#7,CAP#8,CAP#9,CAP#10,CAP#11,CAP#12,CAP#13,CAP#14,CAP#15,CAP#16,CAP#17,CAP#18,CAP#19,CAP#20,CAP#21,CAP#22,CAP#23,CAP#24,CAP#25,CAP#26,CAP#27,CAP#28,CAP#29,CAP#30,CAP#31,CAP#32,CAP#33,CAP#34,CAP#35,CAP#36,CAP#37,CAP#38,CAP#39,CAP#40,CAP#41,CAP#42,CAP#43,CAP#44,CAP#45,CAP#46,CAP#47,CAP#48,CAP#49,CAP#50,CAP#51,CAP#52,CAP#53,CAP#54,CAP#55,CAP#56,CAP#57,CAP#58,CAP#59,CAP#60,CAP#61,CAP#62,CAP#63,CAP#64,CAP#65,CAP#66,CAP#67,CAP#68,CAP#69,CAP#70,CAP#71,CAP#72,CAP#73,CAP#74,CAP#75,CAP#76,CAP#77,CAP#78,CAP#79,CAP#80,CAP#81,CAP#82,CAP#83,CAP#84,CAP#85,CAP#86,CAP#87,CAP#88,CAP#89,CAP#90,CAP#91,CAP#92,CAP#93,CAP#94,CAP#95,CAP#96,CAP#97,CAP#98,CAP#99,CAP#100,CAP#101,CAP#102,CAP#103,CAP#104,CAP#105,CAP#106,CAP#107,CAP#108,CAP#109,CAP#110,CAP#111,CAP#112,CAP#113,CAP#114,CAP#115,CAP#116,CAP#117,CAP#118,CAP#119,CAP#120,CAP#121,CAP#122,CAP#123,CAP#124,CAP#125,CAP#126,CAP#127,CAP#128,CAP#129,CAP#130,CAP#131,CAP#132,CAP#133,CAP#134,CAP#135,CAP#136,CAP#137,CAP#138,CAP#139,CAP#140,CAP#141,CAP#142,CAP#143,CAP#144,CAP#145,CAP#146,CAP#147,CAP#148,CAP#149,CAP#150,CAP#151,CAP#152,CAP#153,CAP#154,CAP#155,CAP#156,CAP#157,CAP#158,CAP#159,CAP#160,CAP#161,CAP#162,CAP#163,CAP#164,CAP#165,CAP#166,CAP#167,CAP#168,CAP#169,CAP#170,CAP#171,CAP#172,CAP#173,CAP#174,CAP#175,CAP#176,CAP#177,CAP#178,CAP#179,CAP#180,CAP#181,CAP#182,CAP#183,CAP#184,CAP#185,CAP#186,CAP#187,CAP#188,CAP#189,CAP#190,CAP#191,CAP#192,CAP#193,CAP#194,CAP#195,CAP#196,CAP#197,CAP#198,CAP#199,CAP#200,CAP#201
        where C,A,B are type-variables:
          C extends Foo<A,B> declared in method <A,B,C>make(Class<C>)
          A extends Object declared in method <A,B,C>make(Class<C>)
          B extends Object declared in method <A,B,C>make(Class<C>)
        where CAP#1,CAP#2,CAP#3,CAP#4,CAP#5,CAP#6,CAP#7,CAP#8,CAP#9,CAP#10,CAP#11,CAP#12,CAP#13,CAP#14,CAP#15,CAP#16,CAP#17,CAP#18,CAP#19,CAP#20,CAP#21,CAP#22,CAP#23,CAP#24,CAP#25,CAP#26,CAP#27,CAP#28,CAP#29,CAP#30,CAP#31,CAP#32,CAP#33,CAP#34,CAP#35,CAP#36,CAP#37,CAP#38,CAP#39,CAP#40,CAP#41,CAP#42,CAP#43,CAP#44,CAP#45,CAP#46,CAP#47,CAP#48,CAP#49,CAP#50,CAP#51,CAP#52,CAP#53,CAP#54,CAP#55,CAP#56,CAP#57,CAP#58,CAP#59,CAP#60,CAP#61,CAP#62,CAP#63,CAP#64,CAP#65,CAP#66,CAP#67,CAP#68,CAP#69,CAP#70,CAP#71,CAP#72,CAP#73,CAP#74,CAP#75,CAP#76,CAP#77,CAP#78,CAP#79,CAP#80,CAP#81,CAP#82,CAP#83,CAP#84,CAP#85,CAP#86,CAP#87,CAP#88,CAP#89,CAP#90,CAP#91,CAP#92,CAP#93,CAP#94,CAP#95,CAP#96,CAP#97,CAP#98,CAP#99,CAP#100,CAP#101,CAP#102,CAP#103,CAP#104,CAP#105,CAP#106,CAP#107,CAP#108,CAP#109,CAP#110,CAP#111,CAP#112,CAP#113,CAP#114,CAP#115,CAP#116,CAP#117,CAP#118,CAP#119,CAP#120,CAP#121,CAP#122,CAP#123,CAP#124,CAP#125,CAP#126,CAP#127,CAP#128,CAP#129,CAP#130,CAP#131,CAP#132,CAP#133,CAP#134,CAP#135,CAP#136,CAP#137,CAP#138,CAP#139,CAP#140,CAP#141,CAP#142,CAP#143,CAP#144,CAP#145,CAP#146,CAP#147,CAP#148,CAP#149,CAP#150,CAP#151,CAP#152,CAP#153,CAP#154,CAP#155,CAP#156,CAP#157,CAP#158,CAP#159,CAP#160,CAP#161,CAP#162,CAP#163,CAP#164,CAP#165,CAP#166,CAP#167,CAP#168,CAP#169,CAP#170,CAP#171,CAP#172,CAP#173,CAP#174,CAP#175,CAP#176,CAP#177,CAP#178,CAP#179,CAP#180,CAP#181,CAP#182,CAP#183,CAP#184,CAP#185,CAP#186,CAP#187,CAP#188,CAP#189,CAP#190,CAP#191,CAP#192,CAP#193,CAP#194,CAP#195,CAP#196,CAP#197,CAP#198,CAP#199,CAP#200,CAP#201 are fresh type-variables:
          CAP#1 extends Foo<?,?> from capture of ? extends Foo<?,?>
          CAP#2 extends Object from capture of ?
          CAP#3 extends Object from capture of ?
          CAP#4 extends Object from capture of ?
          CAP#5 extends Object from capture of ?
          CAP#6 extends Object from capture of ?
          CAP#7 extends Object from capture of ?
          CAP#8 extends Object from capture of ?
          CAP#9 extends Object from capture of ?
          CAP#10 extends Object from capture of ?
          CAP#11 extends Object from capture of ?
          CAP#12 extends Object from capture of ?
          CAP#13 extends Object from capture of ?
          CAP#14 extends Object from capture of ?
          CAP#15 extends Object from capture of ?
          CAP#16 extends Object from capture of ?
          CAP#17 extends Object from capture of ?
          CAP#18 extends Object from capture of ?
          CAP#19 extends Object from capture of ?
          CAP#20 extends Object from capture of ?
          CAP#21 extends Object from capture of ?
          CAP#22 extends Object from capture of ?
          CAP#23 extends Object from capture of ?
          CAP#24 extends Object from capture of ?
          CAP#25 extends Object from capture of ?
          CAP#26 extends Object from capture of ?
          CAP#27 extends Object from capture of ?
          CAP#28 extends Object from capture of ?
          CAP#29 extends Object from capture of ?
          CAP#30 extends Object from capture of ?
          CAP#31 extends Object from capture of ?
          CAP#32 extends Object from capture of ?
          CAP#33 extends Object from capture of ?
          CAP#34 extends Object from capture of ?
          CAP#35 extends Object from capture of ?
          CAP#36 extends Object from capture of ?
          CAP#37 extends Object from capture of ?
          CAP#38 extends Object from capture of ?
          CAP#39 extends Object from capture of ?
          CAP#40 extends Object from capture of ?
          CAP#41 extends Object from capture of ?
          CAP#42 extends Object from capture of ?
          CAP#43 extends Object from capture of ?
          CAP#44 extends Object from capture of ?
          CAP#45 extends Object from capture of ?
          CAP#46 extends Object from capture of ?
          CAP#47 extends Object from capture of ?
          CAP#48 extends Object from capture of ?
          CAP#49 extends Object from capture of ?
          CAP#50 extends Object from capture of ?
          CAP#51 extends Object from capture of ?
          CAP#52 extends Object from capture of ?
          CAP#53 extends Object from capture of ?
          CAP#54 extends Object from capture of ?
          CAP#55 extends Object from capture of ?
          CAP#56 extends Object from capture of ?
          CAP#57 extends Object from capture of ?
          CAP#58 extends Object from capture of ?
          CAP#59 extends Object from capture of ?
          CAP#60 extends Object from capture of ?
          CAP#61 extends Object from capture of ?
          CAP#62 extends Object from capture of ?
          CAP#63 extends Object from capture of ?
          CAP#64 extends Object from capture of ?
          CAP#65 extends Object from capture of ?
          CAP#66 extends Object from capture of ?
          CAP#67 extends Object from capture of ?
          CAP#68 extends Object from capture of ?
          CAP#69 extends Object from capture of ?
          CAP#70 extends Object from capture of ?
          CAP#71 extends Object from capture of ?
          CAP#72 extends Object from capture of ?
          CAP#73 extends Object from capture of ?
          CAP#74 extends Object from capture of ?
          CAP#75 extends Object from capture of ?
          CAP#76 extends Object from capture of ?
          CAP#77 extends Object from capture of ?
          CAP#78 extends Object from capture of ?
          CAP#79 extends Object from capture of ?
          CAP#80 extends Object from capture of ?
          CAP#81 extends Object from capture of ?
          CAP#82 extends Object from capture of ?
          CAP#83 extends Object from capture of ?
          CAP#84 extends Object from capture of ?
          CAP#85 extends Object from capture of ?
          CAP#86 extends Object from capture of ?
          CAP#87 extends Object from capture of ?
          CAP#88 extends Object from capture of ?
          CAP#89 extends Object from capture of ?
          CAP#90 extends Object from capture of ?
          CAP#91 extends Object from capture of ?
          CAP#92 extends Object from capture of ?
          CAP#93 extends Object from capture of ?
          CAP#94 extends Object from capture of ?
          CAP#95 extends Object from capture of ?
          CAP#96 extends Object from capture of ?
          CAP#97 extends Object from capture of ?
          CAP#98 extends Object from capture of ?
          CAP#99 extends Object from capture of ?
          CAP#100 extends Object from capture of ?
          CAP#101 extends Object from capture of ?
          CAP#102 extends Object from capture of ?
          CAP#103 extends Object from capture of ?
          CAP#104 extends Object from capture of ?
          CAP#105 extends Object from capture of ?
          CAP#106 extends Object from capture of ?
          CAP#107 extends Object from capture of ?
          CAP#108 extends Object from capture of ?
          CAP#109 extends Object from capture of ?
          CAP#110 extends Object from capture of ?
          CAP#111 extends Object from capture of ?
          CAP#112 extends Object from capture of ?
          CAP#113 extends Object from capture of ?
          CAP#114 extends Object from capture of ?
          CAP#115 extends Object from capture of ?
          CAP#116 extends Object from capture of ?
          CAP#117 extends Object from capture of ?
          CAP#118 extends Object from capture of ?
          CAP#119 extends Object from capture of ?
          CAP#120 extends Object from capture of ?
          CAP#121 extends Object from capture of ?
          CAP#122 extends Object from capture of ?
          CAP#123 extends Object from capture of ?
          CAP#124 extends Object from capture of ?
          CAP#125 extends Object from capture of ?
          CAP#126 extends Object from capture of ?
          CAP#127 extends Object from capture of ?
          CAP#128 extends Object from capture of ?
          CAP#129 extends Object from capture of ?
          CAP#130 extends Object from capture of ?
          CAP#131 extends Object from capture of ?
          CAP#132 extends Object from capture of ?
          CAP#133 extends Object from capture of ?
          CAP#134 extends Object from capture of ?
          CAP#135 extends Object from capture of ?
          CAP#136 extends Object from capture of ?
          CAP#137 extends Object from capture of ?
          CAP#138 extends Object from capture of ?
          CAP#139 extends Object from capture of ?
          CAP#140 extends Object from capture of ?
          CAP#141 extends Object from capture of ?
          CAP#142 extends Object from capture of ?
          CAP#143 extends Object from capture of ?
          CAP#144 extends Object from capture of ?
          CAP#145 extends Object from capture of ?
          CAP#146 extends Object from capture of ?
          CAP#147 extends Object from capture of ?
          CAP#148 extends Object from capture of ?
          CAP#149 extends Object from capture of ?
          CAP#150 extends Object from capture of ?
          CAP#151 extends Object from capture of ?
          CAP#152 extends Object from capture of ?
          CAP#153 extends Object from capture of ?
          CAP#154 extends Object from capture of ?
          CAP#155 extends Object from capture of ?
          CAP#156 extends Object from capture of ?
          CAP#157 extends Object from capture of ?
          CAP#158 extends Object from capture of ?
          CAP#159 extends Object from capture of ?
          CAP#160 extends Object from capture of ?
          CAP#161 extends Object from capture of ?
          CAP#162 extends Object from capture of ?
          CAP#163 extends Object from capture of ?
          CAP#164 extends Object from capture of ?
          CAP#165 extends Object from capture of ?
          CAP#166 extends Object from capture of ?
          CAP#167 extends Object from capture of ?
          CAP#168 extends Object from capture of ?
          CAP#169 extends Object from capture of ?
          CAP#170 extends Object from capture of ?
          CAP#171 extends Object from capture of ?
          CAP#172 extends Object from capture of ?
          CAP#173 extends Object from capture of ?
          CAP#174 extends Object from capture of ?
          CAP#175 extends Object from capture of ?
          CAP#176 extends Object from capture of ?
          CAP#177 extends Object from capture of ?
          CAP#178 extends Object from capture of ?
          CAP#179 extends Object from capture of ?
          CAP#180 extends Object from capture of ?
          CAP#181 extends Object from capture of ?
          CAP#182 extends Object from capture of ?
          CAP#183 extends Object from capture of ?
          CAP#184 extends Object from capture of ?
          CAP#185 extends Object from capture of ?
          CAP#186 extends Object from capture of ?
          CAP#187 extends Object from capture of ?
          CAP#188 extends Object from capture of ?
          CAP#189 extends Object from capture of ?
          CAP#190 extends Object from capture of ?
          CAP#191 extends Object from capture of ?
          CAP#192 extends Object from capture of ?
          CAP#193 extends Object from capture of ?
          CAP#194 extends Object from capture of ?
          CAP#195 extends Object from capture of ?
          CAP#196 extends Object from capture of ?
          CAP#197 extends Object from capture of ?
          CAP#198 extends Object from capture of ?
          CAP#199 extends Object from capture of ?
          CAP#200 extends Object from capture of ?
          CAP#201 extends Object from capture of ?
      1 error

      Attachments

        Activity

          People

            mcimadamore Maurizio Cimadamore
            mcimadamore Maurizio Cimadamore
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: