Replies: 3 comments 8 replies
-
Yeah, I'd like to do something about things at the call site too. Like just yesterday I wrote a thing like foo(Thing.Member(5, Thing.Member.Type.foo)) and it feels silly since it knows it is a Thing.Member when calling foo.... and it knows it is a Thing.Member.Type when doing the enum. |
Beta Was this translation helpful? Give feedback.
-
Why should this be limited to enums? auto myFunc(auto e = <expression>) { ... } be an equivalent to auto myFunc(typeof(<expression>) e = <expression>) { ... } for any expression? |
Beta Was this translation helpful? Give feedback.
-
There's an open PR upstream for yet another proposal: I don't think this is preferable to any of the other things but probably worth looking at since we can pull it too. |
Beta Was this translation helpful? Give feedback.
-
Currently the syntax is needlessly repetitive:
Why should we repeat
MyEnum
twice when the type of the default value already makes the type unambiguous? I propose the syntax:Much more DRY.
Beta Was this translation helpful? Give feedback.
All reactions