Idris2/tests/idris2/total008/partial.idr
Edwin Brady bd093e9cba Propagate totality options on methods
As in Idris 1 - if an interface declares a method as total or covering,
then all implementations have to satisfy that.

Temporarily turn off %default directive again, at least until totality
checking works as it should (this is probably better than removing it
from various places because I'll forget to put them back)
2020-05-21 16:04:22 +01:00

15 lines
193 B
Idris

import Data.List
-- %default total
interface Foo a where
covering
foo : a -> ()
Foo (Maybe String) where
foo Nothing = ()
foo (Just x) = ()
Foo (Maybe Int) where
foo Nothing = ()