groovy
  1. groovy
  2. GROOVY-2665

static typing issue: adding a string to an Integer

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.4
    • Fix Version/s: 1.6.1, 1.5.8, 1.7-beta-1
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      This should not compile:

      groovy> Integer i = 12
      groovy> i += " angry men"
      groovy> println i

      12 angry men

      Best regards,

      Peter

        Issue Links

          Activity

          Hide
          blackdrag blackdrag added a comment -

          you mean it should fail at runtime... then, yes it should fail..

          Show
          blackdrag blackdrag added a comment - you mean it should fail at runtime... then, yes it should fail..
          Hide
          Peter Weemeeuw added a comment -

          Hi Jochen,

          I'm sorry I was wrong it should indeed compile and fail at runtime.

          Regards,

          Peter

          Show
          Peter Weemeeuw added a comment - Hi Jochen, I'm sorry I was wrong it should indeed compile and fail at runtime. Regards, Peter
          Hide
          blackdrag blackdrag added a comment -

          there seems to be a general problem with y= where y is any operator.

          Show
          blackdrag blackdrag added a comment - there seems to be a general problem with y= where y is any operator.
          Hide
          Paul King added a comment -

          Possibly related

          Show
          Paul King added a comment - Possibly related
          Hide
          blackdrag blackdrag added a comment -

          fixed

          Show
          blackdrag blackdrag added a comment - fixed

            People

            • Assignee:
              blackdrag blackdrag
              Reporter:
              Peter Weemeeuw
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: