www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3397] New: Unintended function call to static opCall

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

           Summary: Unintended function call to static opCall
           Product: D
           Version: 1.048
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: moritzwarning web.de


--- Comment #0 from Moritz Warning <moritzwarning web.de> 2009-10-14 06:27:15
PDT ---
Tested with DMD 1.049 and svn r208.
It's a blocker for Tango.

Error: cannot implicitly convert expression (stack.pop()) of type Pair!(uint)
to uint



struct Pair(T)
{
    static Pair opCall(T a, T b)
    {
        return Pair.init;
    }
}

struct Stack(T)
{
    T pop()
    {
        return T.init;
    }
}

void main()
{
    Stack!(Pair!(uint)) stack;
    Pair!(uint) item = stack.pop; //this line fails, works with stack.pop() or
auto
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 14 2009
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3397


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug yahoo.com.au
         OS/Version|Linux                       |All
           Severity|normal                      |regression


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 15 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3397


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla digitalmars.com


--- Comment #1 from Walter Bright <bugzilla digitalmars.com> 2009-10-15
02:29:09 PDT ---
Why is it a blocker if using stack.pop() works?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 15 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3397



--- Comment #2 from Don <clugdbug yahoo.com.au> 2009-10-15 02:38:29 PDT ---
This was probably caused by my fix to bug 2702. It also caused the other (D2
only) critical regression bug 3367. Both need to be fixed in the next release.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 15 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3397



--- Comment #3 from Walter Bright <bugzilla digitalmars.com> 2009-10-15
03:12:12 PDT ---
I've checked in a fix to this one, but not 3367.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 15 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3397



--- Comment #4 from Moritz Warning <moritzwarning web.de> 2009-10-15 05:49:40
PDT ---
Why is it a blocker if using stack.pop() works?

But it would break existing code (User and Tango code). Anyway, this syntax also isn't encouraged in Tango. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Oct 15 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3397



--- Comment #5 from Moritz Warning <moritzwarning web.de> 2009-10-15 07:00:21
PDT ---
DMD svn r215 now segfaults on this test case.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 15 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3397



--- Comment #6 from Moritz Warning <moritzwarning web.de> 2009-11-06 07:41:33
PST ---
Works with 1.051.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 06 2009
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3397


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


--- Comment #7 from Walter Bright <bugzilla digitalmars.com> 2009-11-06
11:30:39 PST ---
Fixed dmd 1.051 and 2.036

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