Skip to content

Conversation

@ammkrn
Copy link
Contributor

@ammkrn ammkrn commented Jan 26, 2026

Some attributes like to_additive and to_dual create declarations which do not preserve the property that their all list is "a List of all (including this one) declarations in the same mutual block." The current theorem/def/opaque export logic relied on this being the case for all declarations.

This fix ensures that the current "base" declaration is included in the list of names exported, and tries to ensure declarations are not re-exported by the appearance of malformed declarations, for example if:

  • properly formed declaration x has an all list [x], and;
  • improperly formed declaration y has an all list of [x]

then the old/current logic would export x twice if the x declaration was found first; once for the x declaration, and again when exporting y.

Ideally there would be an upstream change to try and ensure that this invariant is preserved, but the exporter should probably be made robust against this either way.

Some attributes like to_additive and to_dual create declarations which
do not preserve the property that their `all` list is "a List of all
(including this one) declarations in the same mutual block." The current
thmeorem/def/opaque export logic relied on this being the case for
all declarations.

This fix ensures that the current "base" declaration is included in
the list of names exported, and tries to ensure declarations are not
re-exported by the appearance of malformed declarations, for example if:

+ declaration `x` has an `all` list `[x]`, and;
+ declaration `y` has an  `all` list of `[x]`

then the old/current logic would export `x` twice if it was found
first; once for the `x` declaration, and again when exporting `y`.

Ideally there would be an upstream change to try and ensure that this
invariant is preserved, but the exporter should probably be made robust
against this either way.
@nomeata nomeata changed the title fix: handle malformed declars from attributes fix: work-around malformed all field in definitions Jan 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant