http://d.puremagic.com/issues/show_bug.cgi?id=2800
Summary: Zeal excess in automatic conversion when using foreach and alias this Product: D Version: unspecified Platform: PC OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: bugzi...@digitalmars.com ReportedBy: and...@metalanguage.com struct Tuple(U...) { U field; alias field this; } struct Iter { bool empty(); void next(); ref Tuple!(int, int) head(); } void main() { foreach (a; Iter()) { } } yields: ./test.d(16): Error: cannot implicitly convert expression (tuple(cast(Tuple!(int,int))__r1.head()._field_field_0,cast(Tuple!(int,int))__r1.head()._field_field_1)) of type (int, int) to Tuple!(int,int) ./test.d(16): Error: cannot implicitly convert expression (tuple(cast(Tuple!(int,int))__r1.head()._field_field_0,cast(Tuple!(int,int))__r1.head()._field_field_1)) of type (int, int) to Tuple!(int,int) --