www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Eror message comprehensibility

Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

I had accidentally written:

 immutable pi =3D 4.0 * reduce ! ( "a + b" ) ( 0 , outputData ) * delta ;

the error message received was:

Error: template instance std.algorithm.reduce!("a + b").reduce!(int,Map!(pa=
rtialSum,Tuple!(int,int,double)[])) error instantiating

which isn't wrong, but neither is it that helpful.  Actually it is
helpful at all really.  Is there no way of saying in a more clear manner
"reduce initial value is an int but the type in the array is double so
they are not addition compatible."?

The correct line is of course:

 immutable pi =3D 4.0 * reduce ! ( "a + b" ) ( 0.0 , outputData ) * delta ;

but that isn't easily deducible from the error message presented.

--=20
Russel.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder ekiga.n=
et
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel russel.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
Nov 17 2010