-
Notifications
You must be signed in to change notification settings - Fork 9
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
Non-empty qualifier missing on array literal type calculation #196
Comments
I'm worried this could lead to a confusing diagnostic. As stated in Slack, I avoid using the non-empty qualifier. If I write an array literal and downstream I see a diagnostic with the |
|
Erm, not sure how I deleted that comment: I have a fix incoming for this same function where the element type calculation for both For example, if you have |
So instead of always qualifying a non-empty literal array type with We don't want I have a fix that basically ignores the non-empty qualifier for coercions when involving non-empty literal arrays. |
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.
In the type calculation for literal arrays, we should be adding a non-empty specifier to the array type when there is at least one element in the literal expression.
The text was updated successfully, but these errors were encountered: