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

Nature filter & map elem type #563

Open
antonmedv opened this issue Feb 13, 2024 · 0 comments
Open

Nature filter & map elem type #563

antonmedv opened this issue Feb 13, 2024 · 0 comments

Comments

@antonmedv
Copy link
Member

filter & map returns []any type. In nature we can keep actual type and implement nature.Elem() method to get correct underlying type.

Those type checker error cases should be able to pass:

map(Any, {0})[0] + "str"
invalid operation: + (mismatched types int and string) (1:18)
 | map(Any, {0})[0] + "str"
 | .................^

map(filter(ArrayOfFoo, {true}), {.Not})
type mock.Foo has no field Not (1:35)
 | map(filter(ArrayOfFoo, {true}), {.Not})
 | ..................................^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant