www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2307] New: Cannot use explicitly instantiated template function with array property syntax

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

           Summary: Cannot use explicitly instantiated template function
                    with array property syntax
           Product: D
           Version: 2.018
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: snake.scaly gmail.com


Explicitly instantiated template functions do not work as array properties. 
Consider the example:

void foo()(char[] x) {}
void main() {
        char[] y;
        foo(y);         // OK
        foo!()(y);      // OK
        y.foo();        // OK
        y.foo!()();     // Error: no property 'foo' for type 'char[]'
}

I expect y.foo!()() to be equivalent of foo!()(y).


-- 
Aug 23 2008