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

Incorrect list type inference #696

Open
brynrhodes opened this issue Dec 3, 2021 · 0 comments
Open

Incorrect list type inference #696

brynrhodes opened this issue Dec 3, 2021 · 0 comments
Labels
Milestone

Comments

@brynrhodes
Copy link
Member

define "Flatten Lists and Elements":
  flatten { { 1, 2, 3 }, 2, 3, 4 }

This test works fine if list promotion is allowed, but if list promotion is disallowed (which is the default for quality improvement artifacts), the list type of the expression should be List, but it incorrectly allows the Any to be downcast to an Integer because Any is "compatible" with any other type. Once a list element type has been inferred as Any, it needs to remain there. Further, because the signature of Flatten requires List<List>, the resolution fails for List and the operator cannot be resolved. This is inconsistent with the intent of allowing flatten to work with Lists of mixed elements of Lists and Singletons.

@brynrhodes brynrhodes added the bug label Dec 3, 2021
@brynrhodes brynrhodes added this to the Maintenance milestone Dec 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant