| |
| Posted by Stewart Gordon | PermalinkReply |
|
Stewart Gordon
| https://issues.dlang.org/show_bug.cgi?id=10819
Stewart Gordon <smjg@iname.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |rejects-valid
CC| |smjg@iname.com
Summary|Invalid comparison for |Implicit conversion error
|equality of lambda |assigning one SortedRange
|functions |to another when a function
| |literal has been used
--- Comment #10 from Stewart Gordon <smjg@iname.com> ---
You completely forgot to post the compiler output. Here's what I get (DMD
2.065 Win32):
bz10189.d(8): Error: cannot implicitly convert expression (c) of type
SortedRange!(int[], (a, b) => a > b) to SortedRange!(int[], (a, b) => a > b)
But the two types are the same.
The same occurs when a D1-style function literal is used
----- bz10189a.d -----
void main() {
import std.range;
SortedRange!(int[], "a > b") a;
SortedRange!(int[], "a > b") b;
b = a;
SortedRange!(int[], function bool(a, b) { return a > b; }) c;
SortedRange!(int[], function bool(a, b) { return a > b; }) d;
d = c;
}
----------
C:\Users\Stewart\Documents\Programming\D\Tests\bugs>dmd bz10189a.d
bz10189a.d(8): Error: cannot implicitly convert expression (c) of type
SortedRange!(int[], function bool(a, b)
{
return a > b;
}
) to SortedRange!(int[], function bool(a, b)
{
return a > b;
}
)
----------
--
|