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

Attempt to upgrade values to any leads to unreachable code being executed. #394

Closed
matzemathics opened this issue Oct 31, 2023 · 1 comment · Fixed by #395
Closed

Attempt to upgrade values to any leads to unreachable code being executed. #394

matzemathics opened this issue Oct 31, 2023 · 1 comment · Fixed by #395
Assignees
Labels
bug Something isn't working logical logical layer type system Issue related to the type system
Milestone

Comments

@matzemathics
Copy link
Collaborator

Example:

values(42).

@declare result(any).
result(?v) :- values(?v).

The type inference (correctly) infers the type of values should be integer. However it does not complain, that there is currently no support for casting integers into any, eventually reaching unreachable code.

thread '<unnamed>' panicked at nemo/src/model/types/primitive_logical_value.rs:407:18:
internal error: entered unreachable code: If the database representation of the logical types is correct, we never reach this branch.
@matzemathics matzemathics added bug Something isn't working physical physical layer type system Issue related to the type system labels Oct 31, 2023
@monsterkrampe
Copy link
Member

monsterkrampe commented Oct 31, 2023

Nice find!
Seems like replace_with_max_type_if_compatible is currently allowing too many "compatibilities".
I will look into it :)

@monsterkrampe monsterkrampe self-assigned this Oct 31, 2023
@github-project-automation github-project-automation bot moved this to Todo in nemo Oct 31, 2023
@monsterkrampe monsterkrampe added this to the Release 0.4.0 milestone Oct 31, 2023
@monsterkrampe monsterkrampe added logical logical layer and removed physical physical layer labels Nov 1, 2023
@monsterkrampe monsterkrampe linked a pull request Nov 1, 2023 that will close this issue
@github-project-automation github-project-automation bot moved this from Todo to Done in nemo Nov 1, 2023
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 a pull request may close this issue.

2 participants