Skip to content

do not generalize the type of every sub-pattern, only of variables#1745

Merged
trefis merged 2 commits intoocaml:trunkfrom
trefis:generalize-var
May 4, 2018
Merged

do not generalize the type of every sub-pattern, only of variables#1745
trefis merged 2 commits intoocaml:trunkfrom
trefis:generalize-var

Conversation

@trefis
Copy link
Copy Markdown
Contributor

@trefis trefis commented Apr 30, 2018

As I said on #1675:

in type_cases when propagate is true [...] we pull the type of every pattern (i.e. including subpatterns) to the level of the match, before trying to generalize it.
[...]
However, if I understand correctly, we don't actually need to lift & generalize the type of every subpattern, only of things added to the environment (i.e. variables).

And I mentioned it again here : #1735 (comment) , where @garrigue seemed to agree.

Copy link
Copy Markdown
Contributor

@lpw25 lpw25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks correct and the idea behind the change is fine.

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

Successfully merging this pull request may close these issues.

2 participants