T0024b — Static analysis: strict mode
Part of the roadmap. Phase 1 · wave 6 · size M.
- Depends on: T0024a
- Area:
area:core - Tier hint:
risk:high: the publicstrictoption, so the core tier with a second reviewer from the other vendor. - Parallel with: –
- Parent: T0024, split on 2026-11-12.
Goal
Level 3 of the T0024 design notes: strict mode (N1 §11) on the type and cardinality inference of T0024a, including the order-dependent operations of #72.
Scope
- The
strictcompile option, internal and public, off by default. It changes what compiles, never what an expression evaluates to (spec notes). - With
strict: true, the analyzer reports as errors:semantic/singleton-expected: a value whose cardinality is known to allow more than one item where an operator or function takes a single item (Patient.name.given < 'X',Patient.name.given.substring(1)), from thesingletonexpectations the functions declare infunctions/define.ts. Equality only in the narrower case §11 describes: one operand may repeat and the other is a single item (Patient.name.given = 'Wouter'); two collections (Patient.name = Patient.name) stay valid. A value of unknown cardinality, such as a path without a model, is never reported.semantic/type-mismatch: the operator warnings of T0024a, a single value that is not a Boolean where one is expected (testIif6), and equality between two single items of types that are never equal.semantic/unordered-collection:first(),last(),tail(),skip(),take()and the indexer on the result ofchildren()ordescendants(), or on what is derived from it item by item, whose order N1 §3.1 leaves undefined (testDollarOrderNotAllowed, #72). Theorderedexpectation and hint infunctions/define.tscarry what the functions know.
- Unknown types and ignored fractions stay warnings in strict mode.
- The conformance runner's adapter sets
strictformode="strict". - The runtime half of T0018's strict rule, an error for an element the model does not have when the type is known only at run time, is #216.
Acceptance criteria
-
testIif6andtestDollarOrderNotAllowedpass in R4 and R5, so everyinvalid="semantic"test in phase 1 passes. - In strict mode,
Patient.name.given < 'X',Patient.name.given.substring(1)andPatient.name.given = 'Wouter'aresemantic/singleton-expectedwithinputType: 'Patient';Patient.name = Patient.name,Patient.name.given.first() = 'Wouter'andPatient.name.select(given.first() + ' ' + family)are valid; nothing is reported without a model or an input type. - In strict mode,
first(),last(),tail(),skip(),take()and the indexer onchildren()anddescendants()aresemantic/unordered-collection;count(),where(),single()andexists()on them are valid. - Unknown-type warnings do not become compile errors in strict mode, and the fraction warnings compile in strict mode too, with the same results as before.
- The public
strictoption is accepted bycompile(),evaluate()andanalyze(), rejected when it is not a Boolean, and the cases above run against the realr4,r5andr6providers.