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

The match function does not accept a type alias

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 5.5.2
    • Component/s: None
    • Labels:
      None
    • Template:
      PUP Bug Template
    • Sub-team:
    • Team:
      Platform Core
    • Sprint:
      Platform Core KANBAN
    • Method Found:
      Needs Assessment
    • Zendesk Ticket IDs:
      33510
    • Zendesk Ticket Count:
      1
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      It was not possible to use aliased (custom) data type or a Variant type with the match() function. This is now fixed.
    • QA Risk Assessment:
      No Action

      Description

      The Problem

      Passing a type alias to the match function results in an error.

      Example Code:

      https://github.com/npwalker/regex_variable/blob/test_pattern_type_alias/manifests/profile/test.pp#L14

      And example error:

      error during compilation: Evaluation Error: Error while evaluating a Method call, match() expects pattern of T, where T is String, Regexp, Regexp[r], Pattern[p], or Array[T]. Got Puppet::Pops::Types::PTypeAliasType (file: /home/travis/build/npwalker/regex_variable/spec/fixtures/modules/regex_variable/manifests/profile/test.pp, line: 14, column: 21) on node travis-job-npwalker-regex-variable-124411915.travisci.net
      

      Which can been seen in travis as well:

      https://travis-ci.com/npwalker/regex_variable/jobs/124411915#L532

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            nick.walker Nick Walker
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support