typeof and block statements

simendsjo simen.endsjo at pandavre.com
Thu Aug 12 07:44:20 PDT 2010


On 12.08.2010 16:39, Steven Schveighoffer wrote:
(...)
>>
>> Tested with dmd 2.048 on win7.
>>
>> pragma(msg, "module:"~typeof({return 1;}()).stringof);
>>
>> void main()
>> {
>> pragma(msg, "main:"~typeof({return 1;}()).stringof);
>> //typeof({return 1;}()) a; // found 'a' when expecting ';' following
>> statement
>> }
>>
>> prints
>> module:int
>> main:int
>>
>
> Ahh. It fails on 2.047 also if you put the statement inside main. If you
> declare it outside main, it works.
>
> Looks like a bug. Please file http://d.puremagic.com/issues/enter_bug.cgi
>
> -Steve

http://d.puremagic.com/issues/show_bug.cgi?id=4633


More information about the Digitalmars-d-learn mailing list