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

[Relay] Ensure nested higher-order functions are treated correctly #2676

Merged
merged 3 commits into from
Feb 27, 2019

Conversation

slyubomirsky
Copy link
Contributor

@slyubomirsky slyubomirsky commented Feb 26, 2019

This PR addresses an issue that @MarisaKirisame brought to my attention (and indeed, resulted in a TODO in code that was merged into mainline). Namely, if a higher-order function (e.g., a polymorphic id function) were nested inside another function, it could cause type-checking to fail because Relay presently only supports polymorphism at the top level.

This PR attempts to solve that problem by instantiating any nested polymorphic types whenever they occur in type inference. As it happens, doing this inside Unify() in the type checker handles almost all cases, though I would appreciate any review as to whether there may be missing cases. (Or suggestions as to what might be a less clumsy approach to this problem.)

@tqchen tqchen merged commit d24c7ee into apache:master Feb 27, 2019
@tqchen
Copy link
Member

tqchen commented Feb 27, 2019

Thanks, @slyubomirsky this is merged, please request reviewers next time

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

Successfully merging this pull request may close these issues.

2 participants