{"record":{"id":"5a133a4762b5b116","repo":"Humanizr/Humanizer","slug":"path-aliases-node-to-a-case-or-unit-that-i","errorCode":null,"errorMessage":"'{path}' aliases '{node}' to a case or unit that is not applicable or unsupported.","messagePattern":"'(.+?)' aliases '(.+?)' to a case or unit that is not applicable or unsupported\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Humanizer.SourceGenerators/Common/DurationCaseModels.cs","lineNumber":1028,"sourceCode":"                        unitName,\n                        inventory,\n                        realizations,\n                        resolving,\n                        path,\n                        aliasing: true);\n                    break;\n                case DurationCaseRealizationKind.NotApplicable:\n                    result = new DurationCaseUnit(DurationCaseUnitKind.NotApplicable, null);\n                    break;\n                default:\n                    result = new DurationCaseUnit(DurationCaseUnitKind.Unsupported, null);\n                    break;\n            }\n\n            _ = resolving.Remove(node);\n            if (aliasing && result.Kind is DurationCaseUnitKind.NotApplicable or DurationCaseUnitKind.Unsupported)\n            {\n                throw new InvalidOperationException(\n                    $\"'{path}' aliases '{node}' to a case or unit that is not applicable or unsupported.\");\n            }\n\n            return result;\n        }\n\n        static ImmutableArray<string> ParseProvenance(\n            SimpleYamlMapping mapping,\n            string path,\n            bool required)\n        {\n            if (!mapping.TryGetValue(\"provenance\", out var value))\n            {\n                return required\n                    ? throw new InvalidOperationException($\"'{path}' must define provenance.\")\n                    : [];\n            }\n","sourceCodeStart":1010,"sourceCodeEnd":1046,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer.SourceGenerators/Common/DurationCaseModels.cs#L1010-L1046","documentation":"Thrown by ResolveUnit when aliasing is true (i.e. the resolver is following a sameRenderedAs reference) and the resolved target unit turns out to be NotApplicable or Unsupported. The generator forbids aliasing to non-renderable cases because the aliasing case would inherit a non-result, making it ambiguous.","triggerScenarios":"A case's sameRenderedAs points to another case whose realization (or specific unit realization) is marked notApplicable or unsupported, so the resolved DurationCaseUnitKind is NotApplicable or Unsupported and the aliasing guard fires.","commonSituations":"A contributor sets up case A to alias case B, but case B is marked notApplicable (e.g. the language has no distinct genitive for durations). The contributor expected case A to inherit B's actual phrase but instead inherits a void. Also occurs when a unit-level sameRenderedAs targets a unit marked unsupported.","solutions":["Check the target case/unit referenced by sameRenderedAs at the reported node.","If the target is genuinely notApplicable or unsupported, mark the aliasing case/unit as notApplicable or unsupported directly instead of aliasing.","If the target should have a real phrase, author it as a phrase realization instead of notApplicable/unsupported.","Rebuild to confirm the alias resolves to a renderable unit."],"exampleFix":"# before (accusative aliases genitive, but genitive is notApplicable)\naccusative:\n  sameRenderedAs: genitive\ngenitive:\n  notApplicable: language has no genitive duration\n# after\naccusative:\n  notApplicable: language has no accusative duration\ngenitive:\n  notApplicable: language has no genitive duration","handlingStrategy":"validation","validationCode":"# Verify no sameRenderedAs target resolves to notApplicable or unsupported\n# python: for case_name, real in realizations.items():\n#     if 'sameRenderedAs' in real:\n#         target = realizations[real['sameRenderedAs']]\n#         assert 'notApplicable' not in target and 'unsupported' not in target","typeGuard":null,"tryCatchPattern":null,"preventionTips":["If a target case is notApplicable or unsupported, mark the aliasing case the same way directly rather than aliasing.","Review the full alias chain to ensure all terminal cases have authored phrases.","Build after setting up alias chains to catch alias-to-void errors."],"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-14T05:17:29.042Z"}