Thread overview
[Issue 4920] New: Member expression tuple allowed for types, disallowed for expressions
Sep 23, 2010
Shin Fujishiro
Jun 01, 2012
Kenji Hara
Aug 19, 2012
Kenji Hara
September 23, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4920

           Summary: Member expression tuple allowed for types, disallowed
                    for expressions
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: patch
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: rsinfu@gmail.com


--- Comment #0 from Shin Fujishiro <rsinfu@gmail.com> 2010-09-23 03:18:28 PDT ---
Created an attachment (id=765)
Patch against dmd r680

Alias to a non-type tuple can't be used as a member of struct or class. The following code doesn't compile.
--------------------
struct Test(parameters_...)
{
    alias parameters_ parameters;
}
Test!(10, 20, 30) test;
static assert(typeof(test).parameters[1] == 20); // okay
static assert(       test .parameters[1] == 20); // (7)
--------------------
% dmd -o- -c test.d
test.d(7): Error: 10 is not a member
test.d(7): Error: static assert  ((__error) == (__error)) is false
--------------------

DotVarExp::semantic() only allows tuple of member variables as a member. The proposed patch changes it so that other kinds of tuples are allowed. Passed dmd/druntime/phobos tests.

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


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

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


--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2012-06-01 02:03:38 PDT ---
https://github.com/D-Programming-Language/dmd/pull/973

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



--- Comment #2 from github-bugzilla@puremagic.com 2012-08-13 02:08:10 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/d2e632003437cbffcdcfbb82bdb2adb8003a9a49
fix Issue 4920 - Member expression tuple allowed for types, disallowed for
expressions

https://github.com/D-Programming-Language/dmd/commit/5590585d14e3664156063fb8ed414cfc56e5199a Merge pull request #973 from 9rnsr/fix4920

Issue 4920 - Member expression tuple allowed for types, disallowed for expressions

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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
            Version|D2                          |D1 & D2
         Resolution|                            |FIXED


--- Comment #3 from Kenji Hara <k.hara.pg@gmail.com> 2012-08-19 02:26:36 PDT ---
D1 fix: https://github.com/D-Programming-Language/dmd/commit/84c5564ebaa7edeeb7d241421535681f40e6ff6b

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