Closed ZlobnyiSerg closed 2 years ago
I'm not sure I quite follow your suggestion, but if I understand correctly it requires a lot more inference and magic than I'd like. It would be difficult to get right to cover all the edges, could have performance implications, and wouldn't cover many of the existing use cases, so I don't think it's something I'd like to add personally.
The only disadvantage I see is code completion. In my proposal no code suggesions will appear because IdType will be unknown type until you'll compile the code. On other side we can always write attribute first, then compile.
The only disadvantage I see is code completion
I see two main disadvantages:
That second point is of significant concern for me, just to save a few key strokes. I wouldn't want to introduce that degree of indirection and ambiguity, so I'm going to close this for now. But thanks for the suggestion! 🙂
Your approach requires some bit of code that could be omitted, I believe. My way is something like:
compiles to: