spec compliance: placeholder options are not enforcing type requirements #342
Labels
bug
Something isn't working
good first issue
Good for newcomers
spec compliance
Behavior is not to the WDL specification
In the function
check_placeholder
inwdl-analysis
, we're accepting arrays of primitives for thesep
option, but otherwise not enforcing the requirements from the WDL specification relating to placeholder options.For the
sep
option, it is only allowed if the type of the expression isArray[P]
(whereP
is any primitive type).For the
default
option, it is only allowed if the type of the expression is optional.For the
true
andfalse
option, it is only allowed if the type of the expression isBoolean
.We should emit diagnostics when the types of the expressions are not the expected one for the option.
Additionally, in
wdl-engine
, we should also be enforcing these requirements and emitting the same diagnostic if the value produced by the expression is of a type that is not supported by the placeholder option.This is needed as the type calculation for an expression in
wdl-analysis
can beUnion
, which means the type is statically indeterminate. An example of this would be~{true="yes" false="no" read_json("file")}
. This should emit no diagnostics fromwdl-analysis
, but should emit a diagnostic error fromwdl-engine
if the file does not contain a boolean.The text was updated successfully, but these errors were encountered: