Skip to content

Reject generic arguments in struct fields#64

Open
pickx wants to merge 2 commits into
mainfrom
reject_generic_arguments
Open

Reject generic arguments in struct fields#64
pickx wants to merge 2 commits into
mainfrom
reject_generic_arguments

Conversation

@pickx
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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