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

Reject generic arguments in struct fields #64

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pickx
Copy link
Collaborator

@pickx pickx commented Jul 23, 2023

as discussed outside github.

@pickx pickx force-pushed the reject_generic_arguments branch from e6eb1a2 to 780ef5f Compare July 23, 2023 19:06
@hecatia-elegua
Copy link
Owner

Thank you.
Had another thought: Where does it start breaking?
If it's just about the field type not being Bitsized, I would not reject them, because you can implement Bitsized yourself. Same with From and so on.
Only getters/setters probably break somewhere, which we should fix or open an issue for.

@kitlith
Copy link
Contributor

kitlith commented Aug 19, 2023

Just noticed this PR after opening #76, which also comes with a workaround. I do not think that rejecting generic structs is the way to go here.

@hecatia-elegua
Copy link
Owner

@kitlith explicitly rejecting generics would have been more of a temporary fix, e.g. you would have gotten the correct error that we currently don't handle them at all.

If you want, you could implement this. I've not thought about this at all, but if adding the turbofish works, it might be easy enough to change all Type<()> -> Type::<()>?

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

Successfully merging this pull request may close these issues.

3 participants