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

Capabilities in union types #49

Closed
sylvanc opened this issue Oct 9, 2014 · 1 comment
Closed

Capabilities in union types #49

sylvanc opened this issue Oct 9, 2014 · 1 comment

Comments

@sylvanc
Copy link
Contributor

sylvanc commented Oct 9, 2014

Capabilities are not encoded at runtime. A union of two types, with differing capabilities, but the same types otherwise, cannot at runtime "determine" what reference was assigned to it.

As a result, when pattern matching, the following should return false, not true:

var x: A ref = A(...)
var y: (A ref | A tag) = x

match y
| var z: A ref => true
else
  false
end

In other words, a union that contains the same "base type" with two different capabilities can only make the weaker guarantee.

@sylvanc
Copy link
Contributor Author

sylvanc commented Dec 10, 2014

Fixed.

@sylvanc sylvanc closed this as completed Dec 10, 2014
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