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

Category does not select method with correct signature

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1-rc-1
    • 1.1-rc-3
    • None
    • None

    Description

      The following code

       
      class PrimeSupport {
          static isPrime(Number candidate){
              true
          }
          static isPrime(Float candidate) { false }
          static isPrime(Double candidate) { false }
          static isPrime(BigDecimal candidate) { false }
      }
      
      use(PrimeSupport) {
         
          println 13.isPrime()
          println 13.2.isPrime()
      
      }
      

      returns true and true with JDK 1.5 and 1.6, Groovy 1.1-Beta3 and HEAD.

      With JDK1.4 it return true and false with Groovy 1.1-Beta3, but with
      HEAD it also returns true and true.

      My understanding is that it should return true and false. Is my
      understanding wrong?

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            jbaumann Joachim Baumann
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: