javac is accepting a self-referencing variable initializer inside a lambda expression

XMLWordPrintable

    • b78
    • Verified

        This test case:

        class Tmp
        {
            final FunctionalInterface notInitialized = ()-> {
                    FunctionalInterface simpleVariable = () -> notInitialized.foo();
            };
        }

        interface FunctionalInterface {
            void foo();
        }

        should be rejected by javac as notInitialized is being used in the initializer

        reported by Ella Nekipelova

              Assignee:
              Vicente Arturo Romero Zaldivar
              Reporter:
              Vicente Arturo Romero Zaldivar
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: