Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
This PR replaces the catch-all "unsupported pattern in syntax match" error that the new `do` elaborator produces for typical pattern mistakes (#2215, #8304, #10393) with the proper diagnostics from the regular pattern-var collector (e.g. "Invalid pattern: Expected a constructor or constant marked with `[match_pattern]`", "ambiguous pattern, use fully qualified name"), pointing at the offending pattern. `getPatternVarsEx` / `getPatternsVarsEx` in `Lean.Elab.Do` now try the syntax-quotation collector first (cheaply handling identifiers, holes, and antiquotations) and fall back to the regular pattern-var collector for everything else. When both fail, the regular collector's error wins via `<|>` semantics. The legacy `do` elaborator is intentionally left untouched, so the existing `tests/elab/doSyntaxPatternError.lean` guards (which capture the cryptic messages produced under legacy default) are unchanged. They will need updating when the new `do` elaborator becomes default. Fixes #2215, #8304, and #10393 for the new `do` elaborator. |
||
|---|---|---|
| .claude | ||
| .github | ||
| .vscode | ||
| doc | ||
| images | ||
| releases_drafts | ||
| script | ||
| src | ||
| stage0 | ||
| tests | ||
| .gitattributes | ||
| .gitignore | ||
| .gitpod.Dockerfile | ||
| .gitpod.yml | ||
| .ignore | ||
| AGENTS.md | ||
| CMakeLists.txt | ||
| CMakePresets.json | ||
| CODEOWNERS | ||
| CONTRIBUTING.md | ||
| flake.lock | ||
| flake.nix | ||
| lean-toolchain | ||
| LICENSE | ||
| LICENSES | ||
| README.md | ||
| RELEASES.md | ||
This is the repository for Lean 4.
About
- Quickstart
- Homepage
- Theorem Proving Tutorial
- Functional Programming in Lean
- Documentation Overview
- Language Reference
- Release notes starting at v4.0.0-m3
- Examples
- External Contribution Guidelines
Installation
See Install Lean.
Contributing
Please read our Contribution Guidelines first.
Building from Source
See Building Lean.