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

Alias types are presented with the wrong name in type mismatches

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • PUP 4.4.0
    • None
    • None
    • Not Needed
    • Part of not yet released feature.

    Description

      Type aliases are presented the wrong way when there is a type mismatch.
      Given:

      type MyType = Integer[42,42]
      function foo(MyType $a) {
        notice $a
      }
      notice foo(43)
      

      I expect the result to be:

      Error: Evaluation Error: Error while evaluating a Function Call, 'foo' parameter 'a' expects a MyType value, got Integer at ...
      

      But I get this instead:

      Error: Evaluation Error: Error while evaluating a Function Call, 'foo' parameter 'a' expects a TypeA value, got Integer at ...
      

      It seems that it not only got the type name wrong, but it also failed to point out that the value is 43, and not the expected 42.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support