dmd 2.068 deducing purity

Steven Schveighoffer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Aug 25 11:03:21 PDT 2015


On 8/25/15 1:05 PM, Jack Applegame wrote:
> On Tuesday, 25 August 2015 at 14:05:17 UTC, Steven Schveighoffer wrote:
>> Can you post an example?
>
> import std.range;
> import std.algorithm;
>
> class Foo {
>      int baz() {    return 1;}
>      void bar() {
>          auto s = [1].map!(i => baz()); // compiles
>          auto r = [1].map!(i => [1].map!(j => baz())); // Error: need
> 'this' for 'baz' of type 'int()'
>      }
> }


https://issues.dlang.org/show_bug.cgi?id=14962

-Steve


More information about the Digitalmars-d-learn mailing list