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

Typesafe generics on Type trait #45

Closed
oscartbeaumont opened this issue Feb 22, 2023 · 1 comment
Closed

Typesafe generics on Type trait #45

oscartbeaumont opened this issue Feb 22, 2023 · 1 comment
Labels
breaking change This will probs end up in the next major version.
Milestone

Comments

@oscartbeaumont
Copy link
Member

Currently, methods like Type::inline take &[DataType]. This means you can pass an incorrect number of generics. We have a runtime fallback in case of a mistake but it would be nice to just not allow it to be wrong. Given these methods are an implementation detail is not the end of the world but it would be an extra protection against bugs.

Can probs be fixed by something like:

pub trait Type {
    const GENERICS: usize = 2;

    fn inline(..., generics: [DataType; 2]);
}
@oscartbeaumont oscartbeaumont added the breaking change This will probs end up in the next major version. label Apr 24, 2023
@oscartbeaumont oscartbeaumont added this to the v2 milestone Sep 23, 2023
@oscartbeaumont
Copy link
Member Author

Related to #44 but I think it's still slightly different.

@oscartbeaumont oscartbeaumont closed this as not planned Won't fix, can't repro, duplicate, stale Nov 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change This will probs end up in the next major version.
Projects
None yet
Development

No branches or pull requests

1 participant