-
Notifications
You must be signed in to change notification settings - Fork 50
🏗️ [Core Feature]: use nightly feature for mutual exclusivity #560
Copy link
Copy link
Labels
Small2-5 days2-5 days
Description
What is the key feature we're aiming to implement?
Right now, we are utilizing associated types and unit structs to enable mutual exclusivity.
Although this approach works, here is the problem with it:
- say, extensions A and B are incompatible
- say, C and D are incompatible
With our current approach, the following is impossible
- a contract with A and C
- this is due to, to enforce mutual exclusivity, we generate concrete types, say A, B, C, and D
- that's why, if it is A, it cannot be B. But similarly, if it is A, it cannot be C and D either...
We have an alternative solution to this, by utilizing combinatorics, we can have the following:
- AandC
- AandD
- BandC
- BandD
all these will be implementation details, that the end developer won't see and use at all. All the complexity will be hidden, hence, not a bad solution.
However, we found out a nightly feature, that enables us to enforce negative trait bounds directly, without any workarounds with positive bounds.
This feature alone, may be an enough reason to switch to nightly channel
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Small2-5 days2-5 days
Type
Projects
Status
In Progress