Skip to content

Add overload / conversion-precedence test cases - #142

Open
bryantaustin13 wants to merge 2 commits into
cqframework:mainfrom
bryantaustin13:overload-precedence-tests
Open

Add overload / conversion-precedence test cases#142
bryantaustin13 wants to merge 2 commits into
cqframework:mainfrom
bryantaustin13:overload-precedence-tests

Conversation

@bryantaustin13

Copy link
Copy Markdown
Contributor

Summary

Adds library-style tests exercising function-overload resolution and CQL
conversion precedence. Addresses #37.

These use the <library> test format, so this depends on the schema change in
#141
and requires the runner support in cqframework/cql-tests-runner#111 to
execute. It builds on the CqlOverloadMatching.xml file introduced in #61.

Tests added (each a self-contained <library> + one <output name="output">)

Test Overloads Call Expected Rule
ExactIntegerOverThanConversion A(Integer), A(Decimal) A(1) 'IntegerOverload' exact match beats Integer→Decimal
ImplicitIntegerToDecimal A(Decimal) A(1) 'DecimalOverload' implicit conversion when no exact match
ExactLongOverload A(Integer), A(Long) A(1L) 'LongOverload' exact Long match
ImplicitIntegerToLong A(Long) A(1) 'LongOverload' implicit Integer→Long
ExactDecimalOverQuantity A(Decimal), A(Quantity) A(1.0) 'DecimalOverload' exact match beats Decimal→Quantity
AmbiguousOverload A(Long), A(Decimal) A(1) — (<library invalid="semantic">) Integer→both ⇒ ambiguous, fails to translate

Expected outputs were validated against the reference CQL engine. Long tests
carry <capability code="system.long"/>. Each library uses a unique name (the
engine caches inline libraries by name+version).

Merge notes

Depends on #141 · builds on #61 · addresses #37 · runner: cqframework/cql-tests-runner#111

bryantaustin13 and others added 2 commits July 31, 2026 09:33
… a single <expression>, as needed by the overload-matching test in PR cqframework#61.
Library-style tests exercising function-overload resolution and CQL
conversion precedence (exact match vs implicit Integer->Decimal/Long,
Decimal vs Quantity, and an ambiguous overload). Each is a self-contained
CQL library with a unique name. Addresses cqframework#37.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant