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

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7-beta-1
    • 2.5.6, 3.0.0-beta-1
    • Compiler
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: