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

STC: loss of precision check for typecast number literals

    XMLWordPrintableJSON

Details

    Description

      Consider the following:

      @TypeChecked test() {
        byte b = (short) 123
      }
      

      This code warns of "Possible loss of precision". However, the number is okay and there is no way to write a byte or short literal without a typecast.

      Attachments

        Activity

          People

            emilles Eric Milles
            emilles Eric Milles
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: