mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-20 10:02:03 +03:00
2994e23fd0
* [ 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
68 lines
773 B
Idris
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
|