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

STC: floating-point literals no longer accepted as args to method with double parameter

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.4.13
    • Fix Version/s: None
    • Component/s: Static Type Checker
    • Labels:
      None

      Description

      I'm not sure if this recent change was intentional or not. If it is intended, so be it. But in case this has not been seen by anyone else, we had a lot of code that did floating-point computations and used @CompileStatic. Starting with Groovy 2.4.13 (I think), we are seeing STC errors.

      import groovy.transform.CompileStatic
      
      @CompileStatic
      class Static {
      
        def main() {
          meth(1.0) // STC error
        }
      
        def meth(double val) {
        }
      }
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              emilles Eric Milles
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: