-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
23: Ensure DispatchedSet unique keys on construction r=charleskawczynski a=charleskawczynski This PR changes the behavior so that we error on the construction of `DispatchedSet`s, rather than throwing an error on `getindex(::DispatchedSet, key)` for non-unique keys. I think I prefer this behavior, erroring on construction. At first I tried using `unique_elems`, but this incurred runtime overhead. Then, I tried the generated function `elems_are_unique`, and that seems to keep things all at compile time 🚀! I think it's still useful for users to have `unique_elems` / `unique_keys(dt::AbstractDispatchedTuple)`, in case they may want to convert a `DispatchedTuple` into a `DispatchedSet`. I'll avoid exporting for now so that we can bikeshed the name / design. Co-authored-by: Charles Kawczynski <[email protected]>
- Loading branch information
Showing
2 changed files
with
55 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters