Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-3615

Remove automatic string to number conversion

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 3.7.4
    • Component/s: Compiler
    • Labels:
      None
    • Template:
    • Story Points:
      2
    • Sprint:
      Platform Server 2014-11-12, Platform Server 2014-11-26, Platform Server 2014-12-17

      Description

      After having had a discussion about this on the puppet-dev mailing list it is clear that those who voiced an opinion want puppet to be explicit about string/numbers and not do automatic conversion. This because of the various problems with strings recognized and compared as numbers in situations where this is clearly the wrong thing to do.

      Examples '3.10' == '3.1' is true since they are compared as numbers.

      The implementation should:

      • treat instance of String == instance of Number to always be false
      • raise error if comparing <, >, <=, >= with String / Number
      • (and obviously) never automatically convert a String to a Number
      • Adhere to the same rules in case, select, and in operators

      The work in this ticket also includes updating the specification.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              henrik.lindberg Henrik Lindberg
              QA Contact:
              Kurt Wall Kurt Wall
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support