You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> %default total
> %auto_implicits off
> %access public export
> postulate Real : Type
> postulate plus : Real -> Real -> Real
> postulate mult : Real -> Real -> Real
> postulate fromNat : Nat -> Real
> implementation Num Real where
> (+) = plus
> (*) = mult
> fromInteger = fromNat . fromIntegerNat
fails to type check with
- + Errors (1)
`-- ./Testing/implementation1.lidr line 10 col 17:
Overlapping implementation: Num Integer already defined
which seems an Idris error. Most likely related to #4279 but here in a perhaps more obvious form. Why is it still so difficult to use interfaces? Is there something obviously wrong with the example above? Is the error message is perhaps misleading?
The text was updated successfully, but these errors were encountered:
@ahmadsalim Defining interfaces in terms of postulated features should be fine as long as these features are not accessed at run time. Notiuce that replacing
> implementation Num Real where
with
> implementation [Lala] Num Real where
makes the code type check. Thus, this seems to be just an Idris bug, not a problem with postulates!
The program
fails to type check with
which seems an Idris error. Most likely related to #4279 but here in a perhaps more obvious form. Why is it still so difficult to use interfaces? Is there something obviously wrong with the example above? Is the error message is perhaps misleading?
The text was updated successfully, but these errors were encountered: