lovely compiler error message - incompatible types

Steven Schveighoffer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jul 2 11:01:39 PDT 2015


On 7/2/15 1:33 PM, Laeeth Isharc wrote:
> Hi.
>
> It's not easy to reduce, but I will have a go if other options fail.
>
> Any thoughts on what could be leading to the following:
> ../../../marketdata/source/pricebar.d(397): Error: incompatible types
> for ((bar.high) + (bar.low)): 'FixedDecimal!(int, 8)' and
> 'FixedDecimal!(int, 8)'
> .../../../marketdata/source/pricebar.d(399): Error: incompatible types
> for ((bar.high) + (bar.low)): 'FixedDecimal!(int, 8)' and
> 'FixedDecimal!(int, 8)'
> .../../../marketdata/source/pricebar.d(547): Error: incompatible types
> for ((trueHigh(bars)) - (trueLow(bars))): 'FixedDecimal!(int, 8)' and
> 'FixedDecimal!(int, 8)'
>
> FixedDecimal is a fixed decimal point struct that stores values as an
> int or long and takes number of decimal places as the second compile
> term argument.  It's possible, if not likely I have made a mistake in
> implementing operator overloads.
>
> Any thoughts on whether this is the likely cause, and if so which ones
> are likely to be the problem?

Can you post the signature to the operator overload? I have an idea of 
what it might be, but it's difficult to explain without context.

-Steve


More information about the Digitalmars-d-learn mailing list