Open
Description
Doc: https://docs.google.com/document/d/1bAG5UHqMw7i8Yoyv1wiIhG2dNlu5vLgOYvWyttYLges/
In case we decide we want to expand on the current variadics design to support symbolic phase pack arity constraints, template phase artity, and constant time query operations on a pack, I'm creating this as a long-term issue so the doc doesn't get lost and is hopefully eventually picked up as a proposal.
class Array(T:! type, N:! u32) {
fn Make(...[== N] each t: T) -> Self {
return {
// In order for this line to compile, the constraint above must be applied.
// Without the constraint, the type checker would have no way of
// knowing if the pack was the same size as the backing array.
.backing_array = (... each t),
};
}
// ...
}