{"record":{"id":"8ede20136b8f375a","repo":"puppetlabs/puppet","slug":"name-can-only-be-called-using-the-4-x-functio","errorCode":null,"errorMessage":"%{name}() can only be called using the 4.x function API. See Scope#call_function","messagePattern":"%(.+?)\\(\\) can only be called using the 4\\.x function API\\. See Scope#call_function","errorType":"exception","errorClass":"Puppet::ParseError","httpStatus":null,"severity":"error","filePath":"lib/puppet/parser/functions.rb","lineNumber":321,"sourceCode":"\n  class << self\n    private\n\n    def merged_functions(environment)\n      root = environment_module(Puppet.lookup(:root_environment))\n      env = environment_module(environment)\n\n      root.all_function_info.merge(env.all_function_info)\n    end\n\n    def get_function(name, environment)\n      environment_module(environment).get_function_info(name.intern) || environment_module(Puppet.lookup(:root_environment)).get_function_info(name.intern)\n    end\n  end\n\n  class Error\n    def self.is4x(name)\n      raise Puppet::ParseError, _(\"%{name}() can only be called using the 4.x function API. See Scope#call_function\") % { name: name }\n    end\n  end\nend\n","sourceCodeStart":303,"sourceCodeEnd":325,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions.rb#L303-L325","documentation":"Error \"%{name}() can only be called using the 4.x function API. See Scope#call_function\" thrown in puppetlabs/puppet.","triggerScenarios":"Thrown at lib/puppet/parser/functions.rb:321 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"}