cqframework / clinical_quality_language

Clinical Quality Language (CQL) is an HL7 specification for the expression of clinical knowledge that can be used within both the Clinical Decision Support (CDS) and Clinical Quality Measurement (CQM) domains. This repository contains complementary tooling in support of that specification.
https://confluence.hl7.org/display/CDS/Clinical+Quality+Language
Apache License 2.0
267 stars 123 forks source link

Inconsistent Message operator resolution behaviour #1401

Open antvaset opened 3 months ago

antvaset commented 3 months ago

I've noticed that Message(1, null, '1', 'Message', 'This is a message') (the second argument is null) fails to translate inside of this library:

library TestLib version '1.0.0'

define y: Message(1, null, '1', 'Message', 'This is a message')

and gives Could not resolve call to operator Message with signature (System.Integer,System.Any,System.String,System.String,System.String).

If I add Message(1, false, '1', 'Message', 'This is a message') or Message(1, null as Boolean, '1', 'Message', 'This is a message') (the second argument is of type System.Boolean) to the same library prior to calling Message with null, it compiles successfully, e.g. both of these compile and run successfully:

library TestLib version '1.0.0'

define x: Message(1, false, '1', 'Message', 'This is a message')
define y: Message(1, null, '1', 'Message', 'This is a message')

and

library TestLib version '1.0.0'

define y: Message(1, null as Boolean, '1', 'Message', 'This is a message') + Message(1, null, '1', 'Message', 'This is a message')