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

Consider using a phantom type in JS<T> to indicate rooted-ness #14901

Closed
jdm opened this issue Jan 6, 2017 · 2 comments
Closed

Consider using a phantom type in JS<T> to indicate rooted-ness #14901

jdm opened this issue Jan 6, 2017 · 2 comments

Comments

@jdm
Copy link
Member

@jdm jdm commented Jan 6, 2017

It has been claimed that being able to write static analysis that verifies safe rooting behaviour is more complex when multiple types are involved (ie. JS<T>, Root<T>). A proposal for reducing this complexity is to add a phantom type to JS<T>, so we get JS<T, Unrooted> or JS<T, Rooted>. More specific examples of why this is easier to analyze would be valuable.

@Ms2ger
Copy link
Contributor

@Ms2ger Ms2ger commented Jan 24, 2017

If we did this, we'd probably want to keep typedefs like type Root<T> = NewThing<T, Rooted>.

@nox
Copy link
Member

@nox nox commented Oct 7, 2017

I don't think this would reduce complexity but instead increase it. Nowadays Root<T> just contains a T, so it's not like it would even help.

@nox nox closed this Oct 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.