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

Cast operator precedence is incorrect

    Details

      Description

      The cast operator precedence is incorrect:

      def i = (int)1/(int)2
      assert i.class==BigDecimal // fails
      

      To have proper casts, we need extra parenthesis which should not be necessary:

      def i = ((int)1)/((int)2)
      assert i.class==BigDecimal // ok
      

        Attachments

          Activity

            People

            • Assignee:
              paulk Paul King
              Reporter:
              melix Cédric Champeau
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: