On 2018-05-21 20:17:04 +0000, Jonathan M Davis said:

On Monday, May 21, 2018 16:05:00 Steven Schveighoffer via Digitalmars-d-
learn wrote:

Well one thing that seems clear from this example -- we now have
__traits(isSame) to tell if lambdas are the same, but it looks like the
compiler doesn't subscribe to that belief...

https://run.dlang.io/is/FW3mVq

We should fix that...

Yeah. That part of lambdas has always been a problem. My guess here is that
the problem stems from the fact that they're declared in separate scopes,
but I don't know. Regardless of the reason for the failure though, that
example really needs to work, or most anything that cares about lambdas
being the same is going to have problems.

I think that's exactly the problem: I assumed that it's about the lambdas and associated types but would have never guessed that names, scope etc. play a role as well. Is this somewhere documented? Or at least a hint, would help a lot to be aware of this pitfall.

--
Robert M. Münch
http://www.saphirion.com
smarter | better | faster

Reply via email to