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


Don <clugd...@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugd...@yahoo.com.au


--- Comment #3 from Don <clugd...@yahoo.com.au> 2012-03-05 04:56:28 PST ---
(In reply to comment #2)
> (In reply to comment #1)
> > With:
> > 
> >   class Foo {}
> >   auto a = (Foo) {}; // error
> > 
> > I get with 2.058 and 2.059:
> > 
> >   Error: cannot infer type from ambiguous function literal __lambda2
> > 
> > That's different from what you say you're getting. It's also correct, as the
> > type of parameter Foo cannot be inferred.
> 
> That's the same as what I get. The error message in the post relates to the
> OwnerTerminated code snippet above it.
> 
> I don't understand what you mean with the type inference for the Foo 
> parameter.
> The type is Foo.

The change in 2.058 was that given:
auto a = (x) { ... };
x is a parameter, of type to be inferred.
Previously, it was assumed to be a type.

> Is this an errata for TDPL?

I believe so. Should be rewritten to something like:

void foo() {
    import std.concurrency;
    receive( (OwnerTerminated  x) { } );
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to