Fix singleton extraction after implicit erasure - #22349
Open
JiaJunDeng5930 wants to merge 1 commit into
Open
Conversation
Author
|
@coqbot run full ci |
Contributor
|
Sorry, @JiaJunDeng5930, I only accept requests from members of the |
JiaJunDeng5930
marked this pull request as ready for review
August 15, 2026 05:35
Member
|
@coqbot run full ci |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #22348
Summary
Extraction Implicit.Root cause
extract_really_indonly excluded logical fields when deciding whether an inductive used the Singleton representation.extract_inductivelater also removed fields declared throughExtraction Implicit. Erasing the sole field could therefore leave a Singleton with no payload, violating the assumptions in constructor and match lowering.When no field remains, the corrected classification uses the Standard representation. Code that does not depend on the erased field now extracts as a nullary constructor; code that still depends on it reaches the existing SafeImplicits error.
Testing
opam exec -- dune exec --root . rocq -- compile -q -bt test-suite/bugs/bug_22348.vThe same focused command passed for
test-suite/success/extraction_impl.v,test-suite/bugs/bug_11114.v, andtest-suite/bugs/bug_13581.v.git diff --checkAdded / updated test-suite.