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

Should Ty have copy semantics? #19

Closed
Trolldemorted opened this issue Oct 22, 2020 · 1 comment
Closed

Should Ty have copy semantics? #19

Trolldemorted opened this issue Oct 22, 2020 · 1 comment

Comments

@Trolldemorted
Copy link
Contributor

In #18 I have put several Tys behind Arcs because you have been using them behind references at some places, but the enum feels like a copy type, since Ty<Name> is the variant used most often (only Ty<String> appears to be used in some other places).

@Alasdair
Copy link
Collaborator

Alasdair commented Oct 22, 2020

It's not copy because of the recursive enum variants that contain Box<Ty<A>>. Cloning (and therefore copying) makes a deep copy of the recursive structure.

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

2 participants