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

TypeCalculator#infer should consider Hash and Array subclasses to be Runtime types.

    XMLWordPrintable

    Details

    • Template:
    • Sub-team:
    • Team:
      Agent
    • Story Points:
      1
    • Sprint:
      PDE 2017-05-31
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      When the type system inferred the type of Ruby object of classes derived from Array and Hash it considered them to be instances of those classes. This was problematic because it made it impossible to treat those objects differently. Now such special Ruby objects are treated as foreign {{Runtime\[Ruby]}} objects (or if registered with the type system as the registered subtype of {{Object}}.

      This affects those with a Ruby extension to Puppet that relied on their special objects being sent over the wire as array or hash objects when they were in fact some special thing.
      Show
      When the type system inferred the type of Ruby object of classes derived from Array and Hash it considered them to be instances of those classes. This was problematic because it made it impossible to treat those objects differently. Now such special Ruby objects are treated as foreign {{Runtime\[Ruby]}} objects (or if registered with the type system as the registered subtype of {{Object}}. This affects those with a Ruby extension to Puppet that relied on their special objects being sent over the wire as array or hash objects when they were in fact some special thing.
    • QA Risk Assessment:
      No Action
    • QA Risk Assessment Reason:
      Covered by spec tests

      Description

      The TypeCalcuclator, when inferring the type of an arbitrary value, will traverse the class inheritance chain when resolving types. The traversal stops when a class is recognized and when all else fails (and class Object is reached), the type is considered to be a Runtime type.

      This works for most cases, but if someone would derive from a known class, such as Hash or Array, then the type of such instances will be inferred to Hash or Array, which is wrong. Since they are unkown classes, the inferred type must be Runtime.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              thomas.hallgren Thomas Hallgren
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support