[Issue 4920] New: Member expression tuple allowed for types, disallowed for expressions
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Sep 23 03:19:12 PDT 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 at puremagic.com
ReportedBy: rsinfu at gmail.com
--- Comment #0 from Shin Fujishiro <rsinfu at 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: -------
More information about the Digitalmars-d-bugs
mailing list