{"record":{"id":"d4e70e1019101e1f","repo":"apple/pkl","slug":"missingfixedmodifier","errorCode":"missingFixedModifier","errorMessage":"missingFixedModifier","messagePattern":"missingFixedModifier","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkl-core/src/main/java/org/pkl/core/ast/member/UnresolvedPropertyNode.java","lineNumber":101,"sourceCode":"    return VmModifier.isImport(modifiers);\n  }\n\n  private void checkOverride(VmClass clazz) {\n    var superClass = clazz.getSuperclass();\n    if (superClass == null) {\n      return;\n    }\n    var superProperty = superClass.getProperty(name);\n    if (superProperty == null) {\n      return;\n    }\n    var isFixed = VmModifier.isFixed(modifiers);\n    if (superProperty.isFixed() == isFixed) {\n      return;\n    }\n    CompilerDirectives.transferToInterpreter();\n    if (superProperty.isFixed()) {\n      throw exceptionBuilder()\n          .withSourceSection(headerSection)\n          .evalError(\n              \"missingFixedModifier\",\n              name,\n              superClass.getQualifiedName(),\n              sourceSection.getCharacters())\n          .build();\n    }\n    var source = headerSection.getCharacters().toString();\n    var fixedModifierIdx = source.indexOf(\"fixed\");\n    throw exceptionBuilder()\n        .withSourceSection(\n            headerSection\n                .getSource()\n                .createSection(headerSection.getCharIndex() + fixedModifierIdx, 5))\n        .evalError(\"cannotApplyFixedModifier\", name, superClass.getQualifiedName())\n        .build();\n  }","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/apple/pkl/blob/f3efcbfc9b60d30053b0536d664948d7aa1b8673/pkl-core/src/main/java/org/pkl/core/ast/member/UnresolvedPropertyNode.java#L83-L119","documentation":"Pkl throws missingFixedModifier when an overriding property is fixed in the superclass but the override omits the `fixed` modifier. UnresolvedPropertyNode.checkOverride enforces modifier consistency between a property and its overridden superclass property: a `fixed` supertype property cannot be re-declared without `fixed`, since allowing that would let subclasses un-fix a value. The error names the property, the superclass's qualified name, and the offending source text.","triggerScenarios":"Overriding a `fixed` property from a base class/module without writing `fixed` on the override; base class updated to make a property `fixed` while subclasses still override without the modifier; generated subclasses not carrying modifiers from the base.","commonSituations":"Library upgrade makes a property fixed, breaking downstream extends; copying an override from a non-fixed sibling property; hand-writing overrides and forgetting modifier parity.","solutions":["Add the `fixed` modifier to the overriding property declaration.","Alternatively, remove the override entirely and rely on the superclass's fixed value.","Check the superclass's declared modifiers and mirror them exactly on the override.","If the base recently became fixed, update all subclasses during the upgrade."],"exampleFix":"// before\nclass Server extends Base {\n  name: String = \"mine\"  // Base.name is fixed\n}\n\n// after\nclass Server extends Base {\n  fixed name: String = \"mine\"\n}","handlingStrategy":"validation","validationCode":"// Before overriding a property, check the superclass declaration's modifiers:\n// Base declares: `fixed name: String` -> your override must also say `fixed`.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy modifiers (fixed/const/abstract/hidden) verbatim from the superclass property when overriding.","Re-check overrides whenever a base class changes modifiers.","Consider not overriding fixed properties at all — inherit the value.","Run pkl eval/tests in CI to catch modifier mismatches immediately."],"tags":["pkl","override","fixed-modifier","inheritance"],"backgroundTag":"conflicting-config-options","analyzedSha":"f3efcbfc9b60d30053b0536d664948d7aa1b8673","analyzedAt":"2026-09-08T13:10:45.570Z","contentChangedAt":"2026-09-08T13:10:45.570Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}