[Issue 10394] New: opBinaryRight!"in" and tuple
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Jun 17 13:48:40 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10394
Summary: opBinaryRight!"in" and tuple
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: regression
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: justin at economicmodeling.com
--- Comment #0 from Justin Whear <justin at economicmodeling.com> 2013-06-17 13:48:39 PDT ---
The following code compiles with 2.062 but not with 2.063:
-------------------------------------------------------
import std.typetuple;
struct Cube
{
alias Address = TypeTuple!(int, int);
//alias Address = int;
int* opBinaryRight(string op)(Address where)
{
return null;
}
}
void main()
{
Cube cube;
cube.Address addr;
auto ptr = addr in cube;
}
---------------------------------------------------------
In 2.063, DMD produces the following:
cube.d(18): Error: rvalue of in expression must be an associative array, not
Cube
Flipping the comments on the two "alias Address" lines causes the sample to
compile under both, so the problem is triggered by the use of a tuple as the
left side of the "in" operator. Using DMD with -v indicates the trouble is
during the semantic3 phase.
--
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