DMD 1.031 and 2.015 releases

Walter Bright newshound1 at digitalmars.com
Wed Jun 18 10:04:51 PDT 2008


Jarrett Billingsley wrote:
> "Walter Bright" <newshound1 at digitalmars.com> wrote in message 
> news:g3ba3r$ppu$1 at digitalmars.com...
> 
>> Good question!
>>
>> Because deducing the return type requires semantic analysis, and for 
>> functions that introduces the old forward reference chicken-and-egg 
>> problem. This doesn't happen with function templates, because semantic 
>> analysis of them doesn't happen until later.
> 
> And what exactly is the problem?  It's "too hard" to implement, or?
> 
> I thought D was supposed to drop forward reference restrictions.
> 
> Furthermore, the compiler already has support for deducing return types for 
> delegate and function literals.

Because the context in which they appear, statements, do not allow 
forward references.

> Why can't the same mechanism be used for 
> declarations? 



More information about the Digitalmars-d-announce mailing list