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

Detection of trait use circular references #1242

Closed
herndlm opened this issue Sep 27, 2022 · 3 comments
Closed

Detection of trait use circular references #1242

herndlm opened this issue Sep 27, 2022 · 3 comments
Milestone

Comments

@herndlm
Copy link
Contributor

herndlm commented Sep 27, 2022

Defining a trait, using itself and also using it in a class leads to endless recursion when methods, properties or constants are queried from the class.
Most likely other circular-trait-usages like a->b->a or so lead to the same.

I should be able to open a PR for this on the weekend the latest. I just created this issue because I was a bit worried since it looks like 6.0 is coming soon :) but I guess this shouldn't be a BC break anyways, would still nice to have it in though

@herndlm
Copy link
Contributor Author

herndlm commented Sep 28, 2022

Most likely I'll refactor the way trait hierarchies are collected and then add circular reference protection. Should I split the changes in 2 PRs?

@kukulich
Copy link
Collaborator

@herndlm I think one PR is ok - maybe two commits. However if the refactoring is needed to implement the circular reference check then one commit should be ok too.

I made some refactoring yesterday too.

@Ocramius
Copy link
Member

Handled in #1253, #1254, #1256

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants