Thread overview
[Issue 6738] New: Can't call templatized property function from within a struct/class method
Sep 28, 2011
Andrej Mitrovic
Oct 08, 2011
Kenji Hara
Oct 08, 2011
Andrej Mitrovic
Jan 27, 2012
Walter Bright
Feb 14, 2012
Walter Bright
Feb 14, 2012
Kenji Hara
Feb 18, 2012
Walter Bright
September 28, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6738

           Summary: Can't call templatized property function from within a
                    struct/class method
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: andrej.mitrovich@gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2011-09-27 17:37:44 PDT ---
struct Foo
{
    int _val;

    @property int val()() { return _val; }
    int get() { return val; }  // fail
}

void main()
{
    Foo bar;
    auto x = bar.val;  // ok
}

Error: cannot implicitly convert expression (val()) of type void to int

Note how I can call the property function without errors from outside Foo's methods, however from inside its methods I can't.

The *real* issue here is that I can't overload templated and non-templated functions. In my own code I have a templated setter and want to use a non-templated getter. However that can't work right now due to bugs, so I'm forced to make the getter a template by adding an empty set of parens.

But as you can see, this introduces yet another new bug. :/

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 08, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6738


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch, rejects-valid


--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2011-10-08 14:04:47 PDT ---
https://github.com/D-Programming-Language/dmd/pull/280

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 08, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6738



--- Comment #2 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2011-10-08 15:15:07 PDT ---
It's absolutely fantastic that this is getting fixed. Major props!

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 26, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=6738



--- Comment #3 from github-bugzilla@puremagic.com 2012-01-26 12:06:13 PST ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/1d4438f151143fcdcb807e257959dd1d588f9048
Issue 6738 - Can't call templatized property function from within a
struct/class method

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 27, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=6738


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 14, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=6738


Walter Bright <bugzilla@digitalmars.com> changed:

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


--- Comment #4 from Walter Bright <bugzilla@digitalmars.com> 2012-02-14 00:31:41 PST ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/de89294e9ed1842c9fc36b5ce0d37cfc14952238 revert commit 1d4438f, fix bug 7498, reopen bug 6738

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 14, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=6738


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|patch                       |pull


--- Comment #5 from Kenji Hara <k.hara.pg@gmail.com> 2012-02-14 05:32:59 PST ---
https://github.com/D-Programming-Language/dmd/pull/715

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 18, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=6738



--- Comment #6 from github-bugzilla@puremagic.com 2012-02-17 19:39:46 PST ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/63dd3e18b32acaf31da81d91bbb10ea8b2aa0651 Merge pull request #715 from 9rnsr/fix6738

fix issue 6738 revisited

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 18, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=6738


Walter Bright <bugzilla@digitalmars.com> changed:

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


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