May 10, 2012 Re: Voldemort Types in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | On Wed, 09 May 2012 23:20:47 -0700, Jacob Carlborg <doob@me.com> wrote: > On 2012-05-09 23:03, Timon Gehr wrote: > >> The type cannot be inferred without full semantic analysis in general. >> Furthermore, it could be different based on compilation options (or >> maybe based on in what order the modules were passed to DMD on the >> command line.) > > That has to be solved, somehow. Pretty much the only option is to completely overhaul DI generation with a limited form of semantic analysis built-in, it would be work, but it's not rocket science. Although decyphering the DMD source can be ... tricky. -- Adam Wilson IRC: LightBender Project Coordinator The Horizon Project http://www.thehorizonproject.org/ |
May 10, 2012 Re: Voldemort Types in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bernard Helyer | Le 09/05/2012 21:23, Bernard Helyer a écrit :
>> You've been busy! Looks like you've hit your 2 article limit.
>>
>> Log-in or register for a free account to get unlimited articles and
>> full access to Dr. Dobb's.
>
> Sorry doctor, but I don't care about that other article that much. My
> god, Dr. Dobb's is such a shit-hole. Walter's articles are their only
> redeeming feature.
Disable coockies. I did noticed this limitation only when I got a coockie enabled computer. This has been fixed quickly.
|
May 11, 2012 Re: Voldemort Types in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On 5/9/12, Andrei Alexandrescu <SeeWebsiteForEmail@erdani.org> wrote: > http://www.reddit.com/r/programming/comments/telhj/voldemort_types_in_d/ "Sorry, that won't work, the compiler will not allow a Voldemort Type to be instantiated outside of its scope (the technical reason is it has no reference to the seed local variable)." Actually you can, although this should probably be disallowed: import std.traits; alias ReturnType!(generator) Gen; Gen gen; void main() { writeln(gen.front); // access violation } |
Copyright © 1999-2021 by the D Language Foundation