File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -72,6 +72,34 @@ class _Default:
7272 * [x for x in Iter [Members [T ]]],
7373]
7474
75+ """TODO:
76+
77+ We would really like to instead write:
78+
79+ type AddInit[T] = NewProtocol[
80+ InitFnType[T],
81+ *Members[T]],
82+ ]
83+
84+ but we struggle here because typing wants to unpack the Members tuple
85+ itself. I'm not sure if there is a nice way to resolve this. We
86+ *could* make our consumers (NewProtocol etc) be more flexible about
87+ these things but I don't think that is right.
88+
89+ The frustrating thing is that it doesn't do much with the unpacked
90+ version, just some checks!
91+
92+ We could fix typing to allow it, and probably provide a hack around it
93+ in the mean time.
94+
95+ Lurr! Writing *this* gets past the typing checks (though we don't
96+ support it yet):
97+
98+ type AddInit[T] = NewProtocol[
99+ InitFnType[T],
100+ *tuple[*Members[T]],
101+ ]
102+ """
75103
76104type AllOptional [T ] = NewProtocol [
77105 * [
You can’t perform that action at this time.
0 commit comments