Using inout in delegate

Maxim Fomin maxim at maxim-fomin.ru
Thu Mar 28 09:34:46 PDT 2013


On Thursday, 28 March 2013 at 14:16:27 UTC, Steven Schveighoffer 
wrote:
> I'm not sure what __aggr1174 is, but you can fix the e error by 
> specifying the type for e (or specifying it as const).
>
> -Steve

This is a foolishness of dmd frontend. It generates names for 
copies, temporaries, etc. These names are not only visible (a 
user can receive error messages referring to such names with no 
idea what are the variables the compiler is talking about) but 
accessible which allows to do funny nonsense stuff, probably 
bypassing type system.

http://dpaste.dzfl.pl/15d67a77

Dmd is the only compiler I am aware of which makes visible 
internal stuff and allows to manipulate it. These names are 
created almost anywhere where there is parameter passing, 
temporary, foreach loop, a tuple access, a lambda or a delegate 
literal and in many other cases. Judging by console dump of this 
stuff when compiling phobos, I come to conclusion that dmd for 
ages is able to accept enormous amount of invalid code.


More information about the Digitalmars-d-learn mailing list