Templated aliases name in compilation error output

Pedro Lacerda pslacerda at gmail.com
Sat Feb 11 19:52:16 PST 2012


Hi all,

When aliases are used I expect to see it names on compile errors. But when
I use:

> struct __Bulk(T) {
>     T[] chunks;
> }
> alias __Bulk!(byte) Bulk;
> alias __Bulk!Bulk   MultiBulk;


The compilation error for:

> void question1() {
>     Bulk("bad");
> }


is:

> bla.d(12): Error: cannot implicitly convert expression ("bad") of type
> string to byte[]
> bla.d(12): Error: structliteral has no effect in expression
> (__Bulk((__error)))


I expected to see (Bulk((__error))) instead of (__Bulk((__error))).

And the runtime output error for:

> void question2() {
>     MultiBulk mb;
>     writeln(typeid(mb));
> }


is:

> bla.__Bulk!(__Bulk!(byte)).__Bulk


Despite in runtime I accept don't see aliases name, if it is needed for
accomplish speed.

What are your opinions about these erros output?

Pedro Lacerda
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20120212/a53a0eb5/attachment.html>


More information about the Digitalmars-d-learn mailing list