Discussion Thread: DIP 1037--Add Unary Operator ...--Community Review Round 1

Stefan Koch uplink.coder at googlemail.com
Wed Nov 4 23:29:03 UTC 2020


On Tuesday, 3 November 2020 at 17:23:23 UTC, Ola Fosheim Grøstad 
wrote:
> On Tuesday, 3 November 2020 at 16:34:39 UTC, Stefan Koch wrote:
>> A Type in practice is just an expression.
>>
>> Consider:
>>
>> alias A(T) = T;
>
> Is it though? It would be nice if alias could bind to 
> expressions, but it clearly can't.
>
> alias T = 42; // fails
>
> enum __tmp = 42;
> alias T = __tmp; // ok

I said all types are expressions.
(Even though the language does not admit it yet.)
Not all expressions are types.





More information about the Digitalmars-d mailing list