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

Deduce types when a function is applied to a record selector #48

Closed
julianhyde opened this issue May 20, 2021 · 1 comment
Closed

Deduce types when a function is applied to a record selector #48

julianhyde opened this issue May 20, 2021 · 1 comment

Comments

@julianhyde
Copy link
Collaborator

Deduce types when a function is applied to a record selector. For example, map #x [{x=1, y=2}, {x=2, y=3}] applies the map function to the record selector #x.

The record selector has a function type {x: something, ...} -> something. When the type resolver has deduced the argument type, in this case {x: int, y: int}, we can deduce what something is.

So we can deduce that #x has type {x: int, y: int} -> int, and the expression map #x [{x=1, y=2}, {x=2, y=3}] has type int list.

@julianhyde
Copy link
Collaborator Author

Fixed in 73992cd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant