Cx language gains runtime-callable phen methods and full contract checking
Two major development commits landed on the Cx programming language's submain branch on July 21, 2026, advancing its gene/phen trait system significantly. The first commit introduces Pass 0 contract conformance, enabling the compiler to validate phen implementations against their gene contracts by checking method arity, parameter types, return types, and Self resolution. Self is now substituted with the concrete receiver type at the AST level before analysis, rather than treated as a floating type parameter. The second commit makes phen methods fully callable at runtime by registering them in the same semantic_impls structure used by impl-block methods, allowing the existing dispatch mechanism to handle them without modification. Sixteen new test fixtures were added across both commits to cover contract mismatches, forward references, multi-type dispatch, and mutation parity between phen and impl methods.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in