Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-10984

Unexpected parser error when having fully qualified classes and constructor references

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • parser-antlr4
    • None

    Description

      I have the following program

      import java.util.function.Supplier;
      import java.util.PriorityQueue;
      
      class Main {
        static final void test() {
          java.util.function.Supplier<java.util.PriorityQueue<Number>> x = java.util.PriorityQueue<Number>::new; // parsing error
      
          Supplier<PriorityQueue<Number>> y = PriorityQueue<Number>::new; // no error
        }
      }
      

      Actual behavior

      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      test.groovy: 6: Unexpected input: '>::' @ line 6, column 101.
         ava.util.PriorityQueue<Number>::new;
                                       ^
      
      1 error
      

      Expected behavior

      Compile successfully

      Tested against master (commit: dc54541306c937a81b8bb16fe4b023c2a7d8ccf2)

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              theosot Thodoris Sotiropoulos
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: