def type(assignment_string)
      # Get location to use in case of error - this produces ruby filename and where call to 'type' occurred
      # but strips off the rest of the internal "where" as it is not meaningful to user.
      #
      rb_location = caller[0]

      begin
        result = parser.parse_string("type #{assignment_string}", nil)
      rescue StandardError => e
        rb_location = rb_location.gsub(/:in.*$/, '')
        # Create a meaningful location for parse errors - show both what went wrong with the parsing
        # and in which ruby file it was found.
        raise ArgumentError, _("Parsing of 'type \"%{assignment_string}\"' failed with message: <%{message}>.\n" +
          "Called from <%{ruby_file_location}>") % {
            assignment_string: assignment_string,
            message: e.message,
            ruby_file_location: rb_location
        }
      end
      unless result.body.kind_of?(Puppet::Pops::Model::TypeAlias)
        rb_location = rb_location.gsub(/:in.*$/, '')
        raise ArgumentError, _("Expected a type alias assignment on the form 'AliasType = T', got '%{assignment_string}'.\n"+
        "Called from <%{ruby_file_location}>") % {
          assignment_string: assignment_string,
          ruby_file_location: rb_location
        }
      end
      @local_types << result.body
    end
def type(assignment_string)
      # Get location to use in case of error - this produces ruby filename and where call to 'type' occurred
      # but strips off the rest of the internal "where" as it is not meaningful to user.
      #
      rb_location = caller[0]

      begin
        result = parser.parse_string("type #{assignment_string}", nil)
      rescue StandardError => e
        rb_location = rb_location.gsub(/:in.*$/, '')
        # Create a meaningful location for parse errors - show both what went wrong with the parsing
        # and in which ruby file it was found.
        raise ArgumentError, _("Parsing of 'type \"%{assignment_string}\"' failed with message: <%{message}>.\n" +
          "Called from <%{ruby_file_location}>") % {
            assignment_string: assignment_string,
            message: e.message,
            ruby_file_location: rb_location
        }
      end
      unless result.body.kind_of?(Puppet::Pops::Model::TypeAlias)
        rb_location = rb_location.gsub(/:in.*$/, '')
        raise ArgumentError, _("Expected a type alias assignment on the form 'AliasType = T', got '%{assignment_string}'.\n"+
        "Called from <%{ruby_file_location}>") % {
          assignment_string: assignment_string,
          ruby_file_location: rb_location
        }
      end
      @local_types << result.body
    end
Defines a local type alias, the given string should be a Puppet Language type alias expression
 in string form without the leading 'type' keyword.
 Calls to local_type must be made before the first parameter definition or an error will
 be raised.

 @param assignment_string [String] a string on the form 'AliasType = ExistingType'
 @api public