A proposal for better template constraint error reporting.

Gor Gyolchanyan gor.f.gyolchanyan at gmail.com
Wed Oct 26 10:26:41 PDT 2011


I agree. But how to address the template constraint problem then?

On Wed, Oct 26, 2011 at 9:16 PM, Jonathan M Davis <jmdavisProg at gmx.com> wrote:
> On Wednesday, October 26, 2011 10:10 bearophile wrote:
>> Gor Gyolchanyan:
>> > The ddoc comments, preceding parts of template constraints would be
>> > used to specify why exactly did the template fail to instantiate, for
>>
>> > example:
>> Good. Is it possible to do the same thing with unittests?
>>
>> /// foo
>> unittest {
>> assert(false);
>> }
>>
>> ==>
>> foo unittest failed
>>
>>
>> But maybe this syntax is better:
>>
>> unittest(foo) {
>> assert(false);
>> }
>
> I'd definitely favor unittest(foo) or unittest("foo") for naming unittest
> blocks (and that's how it's been proposed previously). And since it would
> presumably actually affect the name of the function that the unittest block
> generates, I think that it makes more sense that way rather than making it a
> comment (it also takes up less vertical space).
>
> - Jonathan M Davis
>


More information about the Digitalmars-d mailing list