{"id":"word--match","name":"match","owner":"yeho","package":"language","kind":"keyword","signature":"match","description":"Branch on a closed value shape","context":"Use an enum when the valid states are finite and you want the compiler and reader to see every named possibility.","parameters":[],"returns":"","members":[],"tags":["complete-program","cpu","keyword","logic","yeho"],"updated":"2026-09-09","source":{"repository":"yeho","path":"parser_declarations.cpp parseEnumDecl; parser_statements.cpp parseMatchStatement; conformance payload-enum-patterns"},"status":"experimental","notes":["Plain enums are stable enough for ordinary use; richer payload matching remains experimental across targets.","The removed choice spelling is not accepted. Use enum."],"examples":[{"id":"complete","title":"Warning nonexhaustive","description":"Use an enum when the valid states are finite and you want the compiler and reader to see every named possibility.","code":"enum color\n{\n    red\n    blue\n}\n\ncolor value = color.red\nmatch value\n{\n    color.red { Console.Log(\"red\") }\n}\n","manifest":"package = \"tests.compiler.conformance.warningNonexhaustive\"\nversion = \"0.1.0\"\nlanguageEdition = \"yeho-core-2026.1\"\nbackend = \"cpu-oracle\"\n","tags":["cpu","complete-program"],"verification":"type checked","run":"cpu-oracle","source":"tests/compiler/conformance/warning-nonexhaustive/start.yh","sha256":"7683bbce26b3c9ce913164fcdcc85e96c282efee4a0df972bc462f3c4b2da3d3","checked":"2026-09-09","diagnostic":"","observedOutput":null,"checkedBackend":null}],"searchTerms":[],"url":"https://demonhunterlabs.com/academy/api?item=word--match","json":"https://demonhunterlabs.com/reference/items/word--match.json","markdown":"https://demonhunterlabs.com/reference/text/word--match.md"}
