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

Static and static star imports allow non fully qualified names

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Information Provided
    • None
    • None
    • None
    • None

    Description

      bugs/classes.groovy
      package bugs
      
      class ClassInTheSamePackage {
        static foo() { 42 }
        static class Inner {}
      }
      
      bugs/test.groovy
      package bugs
      
      import static ClassInTheSamePackage.*
      
      println foo() // 42
      println new Inner() // bugs.ClassInTheSamePackage$Inner@159f197
      

      Expected: ClassInTheSamePackage should be unresolved, and consequently foo and Inner will not resolve too
      OR this "feature" should be documented.

      Attachments

        Activity

          People

            emilles Eric Milles
            daniilo Daniil Ovchinnikov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: