refactor: replace `isImplicitReducible` with `Meta.isInstance` in `shouldInline` This PR replaces the `isImplicitReducible` check in `shouldInline` with `Meta.isInstance`. At the base phase, we avoid inlining instances tagged with `[inline]/[always_inline]/[inline_if_reduce]` because their local functions will be lambda lifted during the base phase. Inlining them prematurely creates extra work for the lambda lifter and produces many lambda-lifted closures, which is particularly problematic for the IR interpreter (causing C++ stack overflows through stub closures). The previous `isImplicitReducible` check did not capture the original intent: some `instanceReducible` declarations are not instances. Using `Meta.isInstance` correctly targets only actual instances. This is scope-safe because LCNF compilation runs at `addDecl` time, before any scope changes that could affect instance visibility. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This is the repository for Lean 4.
See Install Lean.
Please read our Contribution Guidelines first.
See Building Lean.