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

Verification error when compiling switch with record patterns

XMLWordPrintable

    • b10

        Fails with verification error:

            public static int runCheckExpressionWithUnconditionalAndParams(R1 r) {
                switch (r) {
                    case R1(Integer i):
                        return meth_I(i);
                    case R1(Object o):
                        return meth_O(o); // problematic case
                }
            }
            public static int meth_I(Integer i) { return 1; }
            public static int meth_O(Object o) { return 2;}

              abimpoudis Angelos Bimpoudis
              abimpoudis Angelos Bimpoudis
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: