hierarchy-builder icon indicating copy to clipboard operation
hierarchy-builder copied to clipboard

Importing Order.TTheory in the middle break the code

Open hivert opened this issue 1 year ago • 0 comments

The following code

From HB Require Import structures.
From mathcomp Require Import all_ssreflect.

Structure foo : Type := Foo {fooval :> seq nat; _ : size fooval == 1}.
HB.instance Definition _ := [isSub of foo for fooval].
HB.instance Definition _ := [Equality of foo by <:].

Import Order.TTheory.   (* HERE *)

Structure bar : Type := Bar {barval :> seq nat; _ : size barval == 0}.
HB.instance Definition _ := [isSub of bar for barval].
HB.instance Definition _ := [Equality of bar by <:].

Fails on the last line with

 Error: eqtype_Equality__to__eqtype_hasDecEq already exists.

On the other hand, if the import of Order.TTheory is before the declaration of foo or not here at all, everything works.

According to @CohenCyril on zulip : this is a bug in the seeded/random name generator.

hivert avatar Dec 11 '23 13:12 hivert