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

Eliminate ambiguities while parsing non-static class creator

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0.0-beta-1, 3.0.9
    • Component/s: None
    • Labels:
      None

      Description

                  public class Computer {
                      public class Cpu {
                          int coreNumber
                          public Cpu(int coreNumber) {
                              this.coreNumber = coreNumber
                          }
                      }
                  }
      
                  def coreNumber = new Computer().new Cpu(4).coreNumber // `new` will be parsed as a method name, but it's wrong
                  assert 4 == coreNumber
      

        Attachments

          Activity

            People

            • Assignee:
              daniel_sun Daniel Sun
              Reporter:
              daniel_sun Daniel Sun
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: