So, User-Defined Attributes

Walter Bright newshound2 at digitalmars.com
Sun Jan 6 17:57:44 PST 2013


On 1/6/2013 5:06 PM, deadalnix wrote:
> On Monday, 7 January 2013 at 00:38:35 UTC, Walter Bright wrote:
>> On 1/6/2013 2:24 PM, deadalnix wrote:
>>> On Saturday, 5 January 2013 at 22:14:47 UTC, Walter Bright wrote:
>>>> On 1/5/2013 2:06 PM, Philippe Sigaud wrote:
>>>>> But why is @(MyType) accepted, whereas @(int) is not?
>>>>
>>>> Because it's looking for an expression inside the parents, and int is not an
>>>> expression.
>>>
>>> And mytype is an expression ?????
>>
>> Parsing happens before semantic analysis. Hence, MyType looks like an expression.
>
> OK, but if int is invalid, should semantic analysis reject MyType as well ?

Tuples accept both types and expressions, and the semantic analyzer loads it 
into the tuple.


More information about the Digitalmars-d mailing list