Prerequisites
Description
In nightlies after 2026-04-08, I get a type error in the derived SizeOf instance for an inductive type with a public and a private constructor. MWE:
module
public inductive Tag where
| provided
| private external
Error:
failed to generate `SizeOf` instance for `Tag`:
type mismatch
Context
This is minimized from an example in Verso, where the private constructor is used to ensure that internal code has made a provided name unique.
Steps to Reproduce
- Use the latest nightly
- Enter the code
- Observe the error
Expected behavior:
No error message.
Actual behavior:
The described error:
failed to generate `SizeOf` instance for `Tag`:
type mismatch
Versions
Lean 4.31.0-nightly-2026-04-11
Target: x86_64-unknown-linux-gnu
Additional Information
Impact
Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.
Prerequisites
https://github.com/leanprover/lean4/issues
Avoid dependencies to Mathlib or Batteries.
https://live.lean-lang.org/#project=lean-nightly
(You can also use the settings there to switch to “Lean nightly”)
Description
In nightlies after 2026-04-08, I get a type error in the derived
SizeOfinstance for an inductive type with a public and a private constructor. MWE:Error:
Context
This is minimized from an example in Verso, where the private constructor is used to ensure that internal code has made a provided name unique.
Steps to Reproduce
Expected behavior:
No error message.
Actual behavior:
The described error:
Versions
Additional Information
Impact
Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.