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

Joint compiler doesn't like classes that contain methods with primitive types for names

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • 1.6.5
    • 1.6.6, 1.7-rc-1
    • None
    • None

    Description

      I defined a method like:

          Integer 'int'(String name) {
              def o = get(name)
              if(o instanceof Number) {
                 return o.intValue()
              }
              else if(o != null) {
                  try {
                      return Integer.parseInt(o.toString())
                  }
                  catch (NumberFormatException e) {
                  }
              }
          }
      

      This compiles fine in Groovy but blows up with the joint compiler with an error like:

       [groovyc] public  java.lang.Integer byte(java.lang.String name) { return (java.lang.Integer)null;}
      

      Attachments

        Activity

          People

            guillaume Guillaume Sauthier
            graemerocher Graeme Rocher
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: