www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9708] New: inout breaks zero parameter IFTI

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9708

           Summary: inout breaks zero parameter IFTI
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: nilsbossung googlemail.com



---
---
cat > test.d <<code
struct S
{
    void f()(inout(Object)) inout {}
}
void main()
{
    S s;
    s.f(new Object);
} 
code
dmd -c -o- test.d
---
test.d(8): Error: template test.S.f does not match any function template
declaration. Candidates are:
test.d(3):        test.S.f()(inout(Object))
test.d(8): Error: template test.S.f()(inout(Object)) cannot deduce template
function from argument types !()(Object)
---

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 12 2013
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9708


Denis Shelomovskij <verylonglogin.reg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |verylonglogin.reg gmail.com



12:19:26 MSD ---
Also it makes impossible to use Template This Parameters:
---
struct S
{
    void f()(inout(void)*) inout { }
    void g(this T)(inout(void)*) inout { }
}

void main()
{
    S s;
    void* p;

    s.f!()(p); // ok
    s.f(p); // error
    s.g!()(p); // error
    s.g!S(p); // error (works without `inout` but not sure it should)
}
---

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