Bug 8225 – UFCS when the first argument is a function

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2012-06-11T13:36:00Z
Last change time
2012-12-26T17:56:47Z
Keywords
rejects-valid
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2012-06-11T13:36:07Z
Is this supposed to be supported? int apply(int function(int) f, int x) { return f(x); } enum bar = (int x) => x; void main() { assert(apply(bar, 10) == 10); // OK assert(bar.apply(5) == 5); // line 5, error } dmd 2.060alpha gives: test.d(5): Error: no property 'apply' for type 'pure nothrow @safe int(int x)'
Comment #1 by andrej.mitrovich — 2012-12-26T16:06:50Z
Fixed in 2.061
Comment #2 by andrej.mitrovich — 2012-12-26T17:56:47Z
(In reply to comment #1) > Fixed in 2.061 Actually also fixed in 2.060 release