-
Notifications
You must be signed in to change notification settings - Fork 85
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
Support generics in bundle derive macro #105
Conversation
We definitely don't want to be constantly rerunning the duplicate check. I think an |
That will only catch duplicate types that are right beside each other though, as in I pushed a commit in which I experimented a bit, let me know what you think about it. I do check for duplicates in the Archetype constructor now and in debug builds it also emits the names of the component types in case it fails. Theoretically this could also be made to output the type name of |
cca0daf
to
684452e
Compare
The
Nice! I'd prefer to just print the name of the duplicated type rather than all the types, though. Additionally, we should find a way to communicate the error without mentioning archetypes, as the average user shouldn't be required to know what those are. Maybe "attempted to allocate an entity with duplicate components"? |
684452e
to
c3d1847
Compare
Right, not sure why I thought that wouldn't work 😅 Alright, it should print the type instead now together with your proposed message which I think fits quite well |
c3d1847
to
0a926a4
Compare
Alright I hope I finally addressed everything. Really sorry for making you have to review more than necessary 😅 |
One other small thing I noticed, the proc-macro currently assumes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this looks great!
Really sorry for making you have to review more than necessary sweat_smile
No worries, still easier than writing it myself 😀
the proc-macro currently assumes std to be always there
Good catch; this should be fixed, but we can leave it for a separate PR.
Fixes #87
This still does the duplication check, unlike tuples which don't do that. Should that stay or not?
Edit: Maybe the dupe check can be made cheaper by making it lazy and only execute once via AtomicBool and closures?