Voldemort Types in D

Timon Gehr timon.gehr at gmx.ch
Wed May 9 14:03:11 PDT 2012


On 05/09/2012 10:09 PM, Jacob Carlborg wrote:
> On 2012-05-09 19:05, Adam Wilson wrote:
>
>> This pull fixes this problem and a bunch of others:
>> https://github.com/D-Programming-Language/dmd/pull/928. However, it
>> currently fails to build on Linux and fails the unittests on Windows
>> thanks to a problem with the dur template function in std.datetime. The
>> solution used by this pull is to include the function body of the
>> auto-function as that was needed to allow Phobos to build correctly
>> using the DRT DI files. This is the only workable solution as DMD does
>> not know the type of an auto-function when DI files are generated. No
>> semantic analysis has been performed and since semantic analysis could
>> change the layout of a module you wouldn't want it to be
>> performed.
>>
>
> The correct way to solve this in the long run is to have the compiler
> replace "auto" with the inferred type. If the whole semantic analysis
> phase cannot be run the we need to have some kind of limited semantic
> analysis phase or some other phase to infer the types.
>

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.)


More information about the Digitalmars-d-announce mailing list