[Issue 12171] Parenthesis-less call fails in static array length context

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Feb 27 04:41:26 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12171


monarchdodra at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |monarchdodra at gmail.com
            Summary|Refused UFCS call for a     |Parenthesis-less call fails
                   |sum()                       |in static array length
                   |                            |context


--- Comment #1 from monarchdodra at gmail.com 2014-02-27 04:41:24 PST ---
Seems unrelated to sum. The same issue happens with any function called UFCS,
without parens. It also happens regardless of input type. For example:

//----
size_t foo(int) {return 1;}
size_t bar() {return 1;}

void main() {
    enum int a = 0;

    enum i = 5.foo; //OK!
    enum j = a.foo; //OK!
    enum k = bar;   //OK!

    int[5.foo] arr1; //OK!
    int[a.foo] arr2; //NOPE
    int[bar  ] arr3; //NOPE
}
//----

The issue appears to simply be that parentless calls in a array-length context
doesn't work? Strangely enough, it works with literals though.

Maybe http://d.puremagic.com/issues/show_bug.cgi?id=11247
Is related?

Changing name.

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


More information about the Digitalmars-d-bugs mailing list