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

Incorrect compiler message for ReceiverParameter in inner class constructor

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 11
    • 11
    • tools
    • None
    • b09

      If we have a receiver parameter in an incorrect position for inner class constructor, the compiler throws a message stating:
      "error: ',', ')', or '[' expected"

      The above error message is not very intuitive. It should throw an error similar to other normal scenarios like normal class methods and inner class methods. In such cases the error thrown is:
      error: as of release 8, 'this' is allowed as the parameter name for the receiver type only, which has to be the first parameter

            vromero Vicente Arturo Romero Zaldivar
            vkhatri Vinod Khatri
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: