Idris2/tests/idris2/interface/interface031/DefaulthintWithDep.idr
Denis Buzdalov 2994e23fd0
[ fix ] Fix search around %defaulthints (#3258)
* [ cleanup ] Move repeating trying-with-unambiguity pattern to a function

* [ fix #2850 ] Search for dependencies for default hints among all hints

* [ fix #2932 ] Always try defaults in dependencies search
2024-06-18 15:39:22 +01:00

68 lines
773 B
Idris

interface X where
x : Nat
f : X => Nat
f = x + 1
namespace NoHintArg
%defaulthint
DefaultX : X
DefaultX = D where
[D] X where x = 5
fDef : Nat
fDef = f
namespace WithDefaultHintArg
interface Y' where
y : Nat
[YY] Y' where
y = 6
%defaulthint
YY' : Y'
YY' = YY
%defaulthint
DefaultX : Y' => X
DefaultX = D where
[D] X where x = 5
fDef : Nat
fDef = f
namespace JustHint
interface Y'' where
y : Nat
Y'' where
y = 6
%hint
DefaultX : Y'' => X
DefaultX = D where
[D] X where x = 5
fDef : Nat
fDef = f
namespace WithHintArg
interface Y''' where
y : Nat
Y''' where
y = 6
%defaulthint
DefaultX : Y''' => X
DefaultX = D where
[D] X where x = 5
fDef : Nat
fDef = f