Geoff Reedy | 5 Feb 19:16
Gravatar

Re: [scala-language] Units of Measurement — Scala Macros to the rescue?

On Feb 5, 2012, at 10:45 AM, Miles Sabin wrote:
> What Rex is saying (quite reasonably IMO) is that whatever the X in
> "equality wrt to X" it should at least be an equivalence relation, ie.
> reflexive, symmetric and transitive.

Shouldn't === use the equivalence relation for the LUB of the argument types.

Given

a: A
b: B
C <: A
C <: B
D <: C

with

eqD being the equivalence relation wrt D
eqC being the equivalence relation wrt C

then you should have

eqD ⊆ eqC

which gives

eqD(a,b) => eqC(a,b)

all by the substitutability principle.

Gmane