Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-4683 static import collection task
  3. GROOVY-3446

Method call resolves to statically imported method instead of equally named local method

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.7-beta-1
    • Fix Version/s: 2.5.6, 3.0.0-beta-1
    • Component/s: Compiler
    • Labels:
      None

      Description

      package groovy.bugs
      
      import static java.lang.System.currentTimeMillis
      
      class Groovy3446_Bug extends GroovyTestCase {
        void testLocalMethodFavoredOverStaticallyImportedMethod() {
          assert currentTimeMillis() == "local method called"
        }
      
        def currentTimeMillis() {
          "local method called"
        }
      }
      

        Attachments

          Activity

            People

            • Assignee:
              daniel_sun Daniel Sun
              Reporter:
              pniederw Peter Niederwieser
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: