{
  "id": "programming.objects.constant-reference-is-immutable",
  "uri": "https://open-misconceptions.github.io/miscon-data/m/programming.objects.constant-reference-is-immutable",
  "uuid": "371c613b-da3c-49d9-917e-3758758a1a81",
  "version": "0.1.1",
  "status": "draft",
  "trust": "low",
  "title": "A constant reference means an unchangeable object",
  "statement": "Declaring an object variable final or const makes the object it refers to unchangeable, so its fields or elements cannot be modified.",
  "kind": "overgeneralization",
  "domain": "programming.objects",
  "about": [
    {
      "scheme": "Miscon",
      "uri": "https://open-misconceptions.github.io/miscon-data/c/programming.objects.immutability"
    }
  ],
  "level_band": [
    "secondary",
    "undergraduate"
  ],
  "locale": "en",
  "evidence_patterns": [
    {
      "item_shape": "predict a mutation through a final/const reference",
      "signature": "predicts an error",
      "example": {
        "item": "const items = [1, 2];\nitems.push(3);\nconsole.log(items);",
        "expected": "[1, 2, 3]",
        "response": "TypeError (or 'not allowed')"
      }
    }
  ],
  "discriminators": {
    "vs_slip": "Consistent across items and the learner says const 'freezes' the value. A slip is a single wrong prediction."
  },
  "relations": {
    "conflicts_with": [
      {
        "external": "https://open-misconceptions.github.io/miscon-data/c/programming.objects.immutability",
        "label": "A constant reference does not make the referenced object immutable"
      }
    ],
    "resolved_by": [
      {
        "external": "https://open-misconceptions.github.io/miscon-data/c/programming.objects.immutability",
        "label": "A constant reference does not make the referenced object immutable"
      },
      {
        "external": "https://open-misconceptions.github.io/miscon-data/c/programming.objects.reference",
        "label": "An object variable holds a reference; assignment copies the reference"
      }
    ]
  },
  "alignments": [
    {
      "scheme": "progmiscon",
      "code": "Java/FinalReferenceImpliesImmutability",
      "uri": "https://progmiscon.org/misconceptions/Java/FinalReferenceImpliesImmutability",
      "relation": "close-match"
    },
    {
      "scheme": "progmiscon",
      "code": "JavaScript/ConstReferenceImpliesImmutability",
      "uri": "https://progmiscon.org/misconceptions/JavaScript/ConstReferenceImpliesImmutability",
      "relation": "close-match"
    }
  ],
  "provenance": {
    "sources": [
      {
        "type": "inventory",
        "citation": "Chiodini, L., Moreno Santos, I., Gallidabino, A., Tafliovich, A., Santos, A. L., & Hauswirth, M. (2021). A curated inventory of programming language misconceptions. In Proceedings of the 26th ACM Conference on Innovation and Technology in Computer Science Education (ITiCSE '21), 380-386.",
        "doi": "10.1145/3430665.3456343",
        "url": "https://progmiscon.org/",
        "note": "Inventory consulted for the misconception name and scope only; progmiscon publishes no licence for its text, so Open Misconceptions' statements and examples are written independently."
      }
    ],
    "origin": "llm-drafted",
    "notes": "Drafted from the cited literature for the Open Misconceptions seed pack; statement, examples and discriminators are original text. Awaiting maintainer review."
  },
  "history": {
    "changelog": [
      {
        "version": "0.1.1",
        "date": "2026-09-05",
        "change": "Schema 0.2 migration: about/alignments carry a free-string scheme (corestandards.org URLs relabelled CCSS where present); trust computed from reviews[] (none yet, so low); no change to the statement or evidence."
      }
    ]
  },
  "license": "CC-BY-4.0"
}
