Skip to content

Commit 0a365a3

Browse files
authored
Merge pull request #288 from math-comp/fix_HB.pack_fun_hirarchy
HB.pack was asserting the key is a type
2 parents 71df792 + 093a8bb commit 0a365a3

File tree

4 files changed

+22
-3
lines changed

4 files changed

+22
-3
lines changed

Changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## UNRELEASED
4+
5+
- **Fix** HB.pack works with structures about functions, and not just
6+
types
7+
38
## [1.3.0] - 2022-07-27
49

510
Compatible with

HB/pack.elpi

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ main Ty Args Instance :- std.do! [
1414
get-constructor Class KC,
1515
get-constructor Structure KS,
1616

17-
std.assert-ok! (coq.elaborate-ty-skeleton TSkel _ T) "HB.pack: not a type",
17+
std.assert-ok! (d\
18+
(coq.elaborate-ty-skeleton TSkel _ T d, d = ok) ;
19+
coq.elaborate-skeleton TSkel _ T d
20+
) "HB.pack: not a well typed key",
1821

1922
private.elab-factories FactoriesSkel T Factories,
2023

_CoqProject.test-suite

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ tests/lock.v
6868
tests/interleave_context.v
6969
tests/not_same_key.v
7070
#tests/factory_sort.v
71-
tests/factory_sort_tac.v
71+
tests/hb_pack.v
7272
tests/declare.v
7373
tests/short.v
7474
tests/primitive_records.v

tests/factory_sort_tac.v renamed to tests/hb_pack.v

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,15 @@ pose X := Foo.pack T (HasFoo.Build A P T H).
111111
Check X : Foo.type A P.
112112
Abort.
113113

114-
End test2.
114+
End test2.
115+
116+
HB.mixin Record isID T (F : T -> T) := { p : forall x : T, F x = x }.
117+
HB.structure Definition Fun T := { F of isID T F }.
118+
119+
Goal forall f : nat -> nat, forall p : (forall x, f x = x ), True.
120+
intros f p.
121+
pose F := isID.Build nat f p.
122+
pose T : Fun.type nat := HB.pack f F.
123+
Check T : Fun.type nat.
124+
Abort.
125+

0 commit comments

Comments
 (0)