Skip to content

Conversation

@kim-em
Copy link
Collaborator

@kim-em kim-em commented Jan 6, 2026

This PR improves the error message when initialize (or opaque) fails to find an Inhabited or Nonempty instance.

Before:

failed to synthesize
  Inhabited Foo

After:

failed to synthesize 'Inhabited' or 'Nonempty' instance for
  Foo

If this type is defined using the 'structure' or 'inductive' command, you can try adding a 'deriving Nonempty' clause to it.

Prompted by https://leanprover.zulipchat.com/#narrow/channel/270676-lean4/topic/initialize.20structure.20with.20IO.2ERef/near/564936030

🤖 Prepared with Claude Code

…nstance

This PR improves the error message when `initialize` (or `opaque`) fails
to find an `Inhabited` or `Nonempty` instance. Previously, the error was
just "failed to synthesize Inhabited Foo", which didn't hint that
`Nonempty` would also work. The new message explains that both were
tried and suggests adding `deriving Nonempty`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@kim-em kim-em added the changelog-language Language features and metaprograms label Jan 6, 2026
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Jan 7, 2026
@leanprover-community-bot
Copy link
Collaborator

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 11e4e44be070ec99bc734e40f8431fd92725842d --onto 0f866236c7c2e77e8d12ff61d08ef48694a0cbfb. You can force Mathlib CI using the force-mathlib-ci label. (2026-01-07 03:47:11)

@leanprover-bot
Copy link
Collaborator

Reference manual CI status:

  • ❗ Reference manual CI will not be attempted unless your PR branches off the nightly-with-manual branch. Try git rebase 11e4e44be070ec99bc734e40f8431fd92725842d --onto 0f866236c7c2e77e8d12ff61d08ef48694a0cbfb. You can force reference manual CI using the force-manual-ci label. (2026-01-07 03:47:12)

@kim-em kim-em added this pull request to the merge queue Jan 7, 2026
Merged via the queue into master with commit f7de0c4 Jan 8, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-language Language features and metaprograms toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants