Skip to content
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

Fix type compatibility where casting is needed #395

Conversation

monsterkrampe
Copy link
Member

Fixes #394

@monsterkrampe monsterkrampe added bug Something isn't working logical logical layer type system Issue related to the type system labels Nov 1, 2023
@monsterkrampe monsterkrampe added this to the Release 0.4.0 milestone Nov 1, 2023
@monsterkrampe monsterkrampe self-assigned this Nov 1, 2023
@monsterkrampe monsterkrampe force-pushed the bugfix/394-attempt-to-upgrade-values-to-any-leads-to-unreachable-code-being-executed branch from 69b253d to 1ea2809 Compare November 1, 2023 07:36
@@ -133,14 +133,6 @@ impl Deref for TupleConstraint {
}
}

impl FromIterator<PrimitiveType> for TupleConstraint {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this since I found it confusing. I was actually expecting that this would always be turned into AtLeast constraints instead of Exact constraints, e.g. when using this on Data Sources.
I think one should rather make this explicit and use the FromIterator implementation below.

@@ -690,6 +690,7 @@ impl<'a> RuleParser<'a> {
/// predicate name together with its arity.
fn parse_qualified_predicate_name(
&'a self,
constraint_is_lower_bound: bool,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When parsing source declarations, the type annotations are always lower bounds. In other cases like outputs, these requirements might be stricter. (Since import / export directives are WIP, I would not polish this right now as I expect things to change in the parser anyway.)

@monsterkrampe monsterkrampe merged commit 30328ef into main Nov 1, 2023
7 checks passed
@monsterkrampe monsterkrampe deleted the bugfix/394-attempt-to-upgrade-values-to-any-leads-to-unreachable-code-being-executed branch November 1, 2023 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working logical logical layer type system Issue related to the type system
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Attempt to upgrade values to any leads to unreachable code being executed.
2 participants