Code behaves incorrectly if it is compiled in std.functional

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Fri Jun 5 05:32:03 PDT 2015


On Fri, 05 Jun 2015 11:07:19 +0000, Meta wrote:

> On Friday, 5 June 2015 at 03:15:46 UTC, anonymous wrote:
>> On Friday, 5 June 2015 at 02:38:39 UTC, ketmar wrote:
>>> here's dustmited source:
>>
>> Further reduced:
>>
>> void unaryFun()(auto int a) pure nothrow @safe @nogc {}
>> alias Identity(F) = F;
>> void main()
>> {
>>   unaryFun!()(41);
>>   static void fun(int n) pure nothrow @safe @nogc {}
>>   alias F = typeof(fun);
>>   pragma(msg, F); /* ...(int n) */
>>   pragma(msg, Identity!F); /* ...(auto int) */
>> }
> 
> 'auto int' doesn't compile with 2.067.1. I know because this is blocking
> a PR I'm working on.

but it does! both with 2.067.1 downloaded from dlang.org and with git 
HEAD. it may not do what you expect it to do (i don't know what it should 
do anyway), but dmd happily accepts that code.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20150605/3ac6b9fd/attachment.sig>


More information about the Digitalmars-d mailing list