summaryrefslogtreecommitdiff
path: root/test-suite/bugs/closed/3998.v
blob: ced13839dde16f91122a705f3740d5f48b1ff17d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Class FieldType (F : Set) := mkFieldType { fldTy: F -> Set }.
Hint Mode FieldType + : typeclass_instances. (* The F parameter is an input *)

Inductive I1 := C.
Inductive I2 := .

Instance I1FieldType : FieldType I1 := { fldTy := I1_rect _ bool }.
Instance I2FieldType : FieldType I2 := { fldTy := I2_rect _ }.

Definition RecordOf F (FT: FieldType F) := forall f:F, fldTy f.

Class MapOps (M K : Set) := {
  tgtTy: K -> Set;
  update: M -> forall k:K, tgtTy k -> M
}.

Instance RecordMapOps F (FT: FieldType F) : MapOps (RecordOf F FT) F :=
{ tgtTy := fldTy; update := fun r (f: F) (x: fldTy f) z => r z }.

Axiom ex : RecordOf _ I1FieldType.

Definition works := (fun ex' => update ex' C true) (update ex C false).
Set Typeclasses Debug.
Definition doesnt := update (update ex C false) C true.