lean4-htt/src/Lean/Compiler
Cameron Zwarich 81740da50a
fix: avoid caching uses of never_extract constants in toLCNF (#8956)
This PR changes `toLCNF` to stop caching translations of expressions
upon seeing an expression marked `never_extract`. This is more
coarse-grained than it needs to be, but it is difficult to do any
better, as the new compiler's `Expr` cache is based on structural
identity (rather than the pointer identity of the old compiler).

The newly added `tests/compiler/never_extract.lean` is also converted
into a `run` tests, because during development I found the order of the
output to `stderr` to be a bit finicky. The reason for making it a
`compiler` test in the first place is that closed term decls work
slightly differently between native code and the interpreter, and it
would be good to test both, but we already have separate tests for
`never_extract` and closed term extraction.

Fixes #8944.
2025-06-24 02:04:56 +00:00
..
IR feat: add initial error explanations (#8934) 2025-06-23 17:24:09 +00:00
LCNF fix: avoid caching uses of never_extract constants in toLCNF (#8956) 2025-06-24 02:04:56 +00:00
AtMostOnce.lean perf: add prelude to all Lean modules 2024-02-18 14:55:17 -08:00
BorrowedAnnotation.lean perf: add prelude to all Lean modules 2024-02-18 14:55:17 -08:00
ClosedTermCache.lean fix: more realizeConst fixes (#7300) 2025-03-03 12:10:40 +00:00
ConstFolding.lean fix: remove incorrect strictOr/strictAnd optimizations (#8594) 2025-06-02 16:14:56 +00:00
CSimpAttr.lean doc: add documentation for builtin attributes (#8173) 2025-06-11 09:04:37 +00:00
ExportAttr.lean doc: add documentation for builtin attributes (#8173) 2025-06-11 09:04:37 +00:00
ExternAttr.lean feat: add support for extern LCNF decls (#6429) 2024-12-20 21:20:56 +00:00
FFI.lean chore: lake: bootstrap Lean include directory (#7967) 2025-04-15 23:15:53 +00:00
ImplementedByAttr.lean doc: add documentation for builtin attributes (#8173) 2025-06-11 09:04:37 +00:00
InitAttr.lean doc: add documentation for builtin attributes (#8173) 2025-06-11 09:04:37 +00:00
InlineAttrs.lean doc: add documentation for builtin attributes (#8173) 2025-06-11 09:04:37 +00:00
IR.lean feat: LCNF -> IR translation (#8211) 2025-05-03 05:34:37 +00:00
LCNF.lean chore: test that there are no orphaned modules (#8082) 2025-04-24 11:55:07 +00:00
Main.lean feat: trace.profiler export to Firefox Profiler (#3801) 2024-04-15 12:13:14 +00:00
MetaAttr.lean fix: meta tag can be added async (#8783) 2025-06-14 11:19:35 +00:00
NameMangling.lean perf: add prelude to all Lean modules 2024-02-18 14:55:17 -08:00
NeverExtractAttr.lean doc: add documentation for builtin attributes (#8173) 2025-06-11 09:04:37 +00:00
NoncomputableAttr.lean doc: add documentation for builtin attributes (#8173) 2025-06-11 09:04:37 +00:00
Old.lean perf: Environment blocker removals from async-proofs branch (#7483) 2025-03-14 13:37:01 +00:00
Options.lean fix: run LCNF checks less often by default (#8764) 2025-06-13 05:39:21 +00:00
Specialize.lean doc: add documentation for builtin attributes (#8173) 2025-06-11 09:04:37 +00:00