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

Remove automatic string to number conversion

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • PUP 3.7.4
    • Compiler
    • None
    • 2
    • 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

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

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support