Need clear error msg. (template instantiating)

CLXX kk_tnr at hotmail.com
Sat Feb 28 10:36:25 PST 2009


I need clear error-messages of compiling.
See this code.

// example.d
import std.conv: to;
void main( ){
    S s;
    to!( int )( s ); // 'to' does not support struct-argument.
}
struct S{
}

'to' cannot convert 'S' to 'int', so that this is error.
Then I got mysterious messages.

"src\phobos\std\conv.d(344): Error: cannot implicitly convert expression (value) of type S to int"
"src\phobos\std\conv.d(206): template instance std.conv.toImpl!(S,int) error instantiating"
"src\phobos\std\conv.d(4): template instance std.conv.to!(int).to!(S) error instantiating"

We know 'std.conv.d' has no error, and assume 'example.d' has some.
The problem is 'std.conv.d' seems to have errors.

The message should be as follows.

"example.d(5): template instance to!(S)(int,S) does not match template declaration."

Thank you for your reading.



More information about the Digitalmars-d mailing list