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

Allow subtyping on optional operands #271

Merged
merged 1 commit into from
Apr 18, 2016
Merged

Allow subtyping on optional operands #271

merged 1 commit into from
Apr 18, 2016

Conversation

rossberg
Copy link
Member

@rossberg rossberg commented Apr 5, 2016

This reverses #180, and adds a number of corresponding tests.

Motivation: not allowing optional operands to be implicitly dropped (1) reduced the compositionality of the language, (2) made it harder to allow multiple targets (like with a br_if also returning its operand), and (3) put an extra burden on bottom-up type checkers, where the arity might not be known upfront. And with multiple value, we eventually would want to lift this restriction again anyway.

This should address issues #227, and enable WebAssembly/design#539.

@jcbeyler, you filed #179, which lead to #180. Are you okay with reverting to status ante quo?

@lukewagner
Copy link
Member

With this change, is the obvious bottom-up algo described here valid? If not, I'd be interested to know what are the cases which differ.

@rossberg
Copy link
Member Author

rossberg commented Apr 5, 2016

@lukewagner, yes, that's the idea: you simply do a join of all branches targeting the block, wrt to the trivial subtyping semi-lattice that has Void as its top type.

@ghost
Copy link

ghost commented Apr 5, 2016

Thank you.

@lukewagner
Copy link
Member

Great, lgtm

@rossberg
Copy link
Member Author

Landing with LGTM and no objections

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