{"record":{"id":"7574e1b496296a58","repo":"apple/pkl","slug":"redundantfixedmodifier","errorCode":"redundantFixedModifier","errorMessage":"redundantFixedModifier","messagePattern":"redundantFixedModifier","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkl-core/src/main/java/org/pkl/core/ast/builder/AstBuilder.java","lineNumber":3023,"sourceCode":"\n    // flag modifier combinations that are never valid right away\n\n    if (VmModifier.isExternal(result) && !ModuleKeys.isStdLibModule(moduleKey)) {\n      throw exceptionBuilder()\n          .evalError(\"cannotDefineExternalMember\")\n          .withSourceSection(createSourceSection(modifiers, ModifierValue.EXTERNAL))\n          .build();\n    }\n\n    if (VmModifier.isLocal(result) && VmModifier.isHidden(result)) {\n      throw exceptionBuilder()\n          .evalError(\"redundantHiddenModifier\")\n          .withSourceSection(createSourceSection(modifiers, ModifierValue.HIDDEN))\n          .build();\n    }\n\n    if (VmModifier.isLocal(result) && VmModifier.isFixed(result)) {\n      throw exceptionBuilder()\n          .evalError(\"redundantFixedModifier\")\n          .withSourceSection(createSourceSection(modifiers, ModifierValue.FIXED))\n          .build();\n    }\n\n    if (VmModifier.isAbstract(result) && VmModifier.isOpen(result)) {\n      throw exceptionBuilder()\n          .evalError(\"redundantOpenModifier\")\n          .withSourceSection(createSourceSection(modifiers, ModifierValue.OPEN))\n          .build();\n    }\n\n    return result;\n  }\n\n  private UnresolvedTypeNode[] doVisitParameterTypes(ObjectBody body) {\n    return doVisitParameterTypes(body.getParameters());\n  }","sourceCodeStart":3005,"sourceCodeEnd":3041,"githubUrl":"https://github.com/apple/pkl/blob/f3efcbfc9b60d30053b0536d664948d7aa1b8673/pkl-core/src/main/java/org/pkl/core/ast/builder/AstBuilder.java#L3005-L3041","documentation":"`local` members cannot be referenced from outside their defining object, so `fixed` (which prevents amendment) adds nothing. AstBuilder rejects `local fixed` with `redundantFixedModifier`, pointing at the FIXED modifier (AstBuilder.java:3023).","triggerScenarios":"Declaring `local fixed foo = ...` in any module, class, or object body.","commonSituations":"Defensive modifier stacking; converting a `fixed` property to `local` without removing `fixed`.","solutions":["Remove the redundant `fixed` modifier and keep `local`.","If you truly need amending-protection with visibility, drop `local` and keep `fixed`."],"exampleFix":"// before\nlocal fixed foo = 1\n// after\nlocal foo = 1","handlingStrategy":"validation","validationCode":"if (/local\\s+fixed\\b/.test(pklSource)) {\n  throw new Error(\"`fixed` is redundant on `local` members; remove one\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember locals cannot be amended anyway, so `fixed` is a no-op.","Apply modifiers minimally; add only when an error demonstrates the need.","Run `pkl eval` in CI to catch modifier conflicts early."],"tags":["pkl","parser","modifier","redundant"],"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"}