{"record":{"id":"740fedd929590958","repo":"Humanizr/Humanizer","slug":"path-references-absent-case-casename","errorCode":null,"errorMessage":"'{path}' references absent case '{caseName}'.","messagePattern":"'(.+?)' references absent case '(.+?)'\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Humanizer.SourceGenerators/Common/DurationCaseModels.cs","lineNumber":967,"sourceCode":"                cases[caseName] = new DurationCaseOverlay(units.ToImmutable());\n            }\n\n            return cases.ToImmutable();\n        }\n\n        static DurationCaseUnit ResolveUnit(\n            string caseName,\n            string unitName,\n            ImmutableArray<string> inventory,\n            ImmutableDictionary<string, DurationCaseRealization> realizations,\n            HashSet<string> resolving,\n            string path,\n            bool aliasing)\n        {\n            if (!inventory.Contains(caseName, StringComparer.Ordinal) ||\n                !realizations.TryGetValue(caseName, out var realization))\n            {\n                throw new InvalidOperationException(\n                    $\"'{path}' references absent case '{caseName}'.\");\n            }\n\n            var node = $\"{caseName}/{unitName}\";\n            if (!resolving.Add(node))\n            {\n                throw new InvalidOperationException(\n                    $\"'{path}' contains a sameRenderedAs cycle at '{node}'.\");\n            }\n\n            DurationCaseUnit result;\n            switch (realization.Kind)\n            {\n                case DurationCaseRealizationKind.Authored:\n                    if (realization.Units.IsEmpty)\n                    {\n                        result = new DurationCaseUnit(DurationCaseUnitKind.SameAsNominative, null);\n                        break;","sourceCodeStart":949,"sourceCodeEnd":985,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer.SourceGenerators/Common/DurationCaseModels.cs#L949-L985","documentation":"Thrown by ResolveUnit when a sameRenderedAs reference (either at the case level or the unit level) targets a case name that is not in the locale's case inventory or does not have a parsed realization. The resolver checks both inventory membership and the realizations dictionary before proceeding.","triggerScenarios":"A unit realization or case realization uses sameRenderedAs to point to a case name that was never declared in the durationCases.cases or durationCases.inventory section, or is misspelled.","commonSituations":"A contributor writes sameRenderedAs: genetive (typo) instead of genitive, or references a case (e.g. 'accusative') that the locale does not actually inventory. Also occurs when a case is removed from the inventory but a sameRenderedAs reference to it is left behind.","solutions":["Check the case name in the sameRenderedAs value at the reported path against the locale's case inventory.","Correct the spelling to match a case declared in the inventory, or add the referenced case to the inventory and provide its realization.","Rebuild to confirm the reference resolves."],"exampleFix":"# before\ngenitive:\n  sameRenderedAs: genetive  # typo\n# after\ngenitive:\n  sameRenderedAs: nominative","handlingStrategy":"validation","validationCode":"# Verify every sameRenderedAs target is in the locale's case inventory\n# python: inventory = set(yaml['durationCases']['cases'].keys())\n#         for case in yaml['durationCases']['realizations'].values():\n#             if 'sameRenderedAs' in case: assert case['sameRenderedAs'] in inventory","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always spell case names exactly as declared in the inventory (use copy-paste or IDE completion from the Cases array).","After removing a case from the inventory, grep for sameRenderedAs references to it.","Build after each sameRenderedAs change to validate the reference chain."],"tags":["humanizer","locale","yaml","source-generator","duration-cases","case-reference","build-time"],"backgroundTag":null,"analyzedSha":"ffc2b77c0f30d2fb176875841424379319d0ae9b","analyzedAt":"2026-08-13T21:42:34.584Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}