-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect type-mismatch error #21
Comments
Hi @theAeon. Thank you very much for reporting this issue! The type coercion part of the WDL specification contains a table of valid type coercions. It defines a coercion from That said, I do agree that if there were a coercion from However, I did just find a counterexample where it is expecting I believe this warrants an issue on the WDL spec for clarification and to explicitly call out a coercion from |
I'll file that issue with the spec and link it back to this issue. |
I've filed openwdl/wdl#685 to track the spec issue. |
Interesting, so the coercion is explicitly defined in spec 1.0. |
@theAeon it appears that way! That makes me suspect it was an unintentional omission as to why it's not supported in 1.1 and 1.2; removing a coercion would certainly be a breaking change! I'm going to preemptively fix this in |
I have a fix for this included with my "finish static analysis" work (i.e. fully analyze workflows). I had to include it there as otherwise we can't pass a check on our own workflows repo. |
This commit implements full static analysis for workflows, including type checking. To perform analysis on workflows, a `WorkflowEvaluationGraph` was implemented that will return a topologically-sorted set of nodes for evaluating the contents of a workflow in the correct order. This also includes several fixes required to remove incorrect diagnostics from checking the `workflows` repository: * Treat a coercion to `T?` for a function argument of type `T` as a preference over any other coercion. * Fix the signature of `select_any` such that it is monomorphic. * Only consider signatures in overload resolution that have sufficient arguments. * Allow coercion from `File` and `Directory` to `String`. * Allow non-empty array literals to coerce to either empty or non-empty. * Fix element type calculations for `Array` and `Map` so that `[a, b]` successfully calculates when `a` is coercible to `b`. * Fix `if` expression type calculation such that `if (x) then a else b` works when `a` is coercible to `b`. * Ensure that only equality/inequality expressions are supported on `File` and `Directory` now that there is a coercion to `String`. * Allow index expressions on `Map`. Included with these changes is a refactoring to place all of analysis diagnostics in `diagnostics.rs`. Fixes stjude-rust-labs#197. Fixes stjude-rust-labs#196. Fixes stjude-rust-labs#167. Fixes stjude-rust-labs/sprocket#21.
It would seem as of version 0.7.0, sprocket is reporting that a coercion from Array[File] to Array[String] is a type mismatch.
Cromwell's implementation of the 1.0 spec disagrees and to my understanding is correct to do so. Files can be coerced to strings, so it follows that arrays of files can be coerced to arrays of strings.
The text was updated successfully, but these errors were encountered: