{"record":{"id":"21724275e1d78a02","repo":"puppetlabs/puppet","slug":"illegal-type-name-type-name","errorCode":null,"errorMessage":"Illegal type name '#{type_name}'","messagePattern":"Illegal type name '#(.+?)'","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/pops/types/type_factory.rb","lineNumber":439,"sourceCode":"  end\n\n  # Produces an instance of the SemVer type\n  def self.sem_ver(*ranges)\n    ranges.empty? ? PSemVerType::DEFAULT : PSemVerType.new(ranges)\n  end\n\n  # Produces a PResourceType with a String type_name A PResourceType with a nil\n  # or empty name is compatible with any other PResourceType.  A PResourceType\n  # with a given name is only compatible with a PResourceType with the same\n  # name.  (There is no resource-type subtyping in Puppet (yet)).\n  #\n  def self.resource(type_name = nil, title = nil)\n    case type_name\n    when PResourceType\n      PResourceType.new(type_name.type_name, title)\n    when String\n      type_name = TypeFormatter.singleton.capitalize_segments(type_name)\n      raise ArgumentError, \"Illegal type name '#{type_name}'\" unless type_name =~ Patterns::CLASSREF_EXT\n\n      PResourceType.new(type_name, title)\n    when nil\n      raise ArgumentError, 'The type name cannot be nil, if title is given' unless title.nil?\n\n      PResourceType::DEFAULT\n    else\n      raise ArgumentError, \"The type name cannot be a #{type_name.class.name}\"\n    end\n  end\n\n  # Produces PClassType with a string class_name.  A PClassType with\n  # nil or empty name is compatible with any other PClassType.  A\n  # PClassType with a given name is only compatible with a PClassType\n  # with the same name.\n  #\n  def self.host_class(class_name = nil)\n    if class_name.nil?","sourceCodeStart":421,"sourceCodeEnd":457,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/type_factory.rb#L421-L457","documentation":"Error \"Illegal type name '#{type_name}'\" thrown in puppetlabs/puppet.","triggerScenarios":"Thrown at lib/puppet/pops/types/type_factory.rb:439 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}