Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/library/constructions/projection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ environment mk_projections(environment const & env, name const & n, buffer<name>
expr proj_val = mk_proj(n, i, c);
proj_val = lctx.mk_lambda(proj_args, proj_val);
declaration new_d;
if (is_prop) {
// TODO: replace `if (false) {` with `if (is_prop) {`.
// Mathlib is crashing when prop fields are theorems.
// The crash is in the ir_interpreter. Kyle suspects this is an use-after-free bug in the interpreter.
if (false) { // if (is_prop) {
bool unsafe = use_unsafe(env, proj_type) || use_unsafe(env, proj_val);
if (unsafe) {
// theorems cannot be unsafe
Expand Down
3 changes: 2 additions & 1 deletion tests/lean/run/2575.lean
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ structure AtLeastThirtySeven where

theorem AtLeastThirtySeven.lt (x : AtLeastThirtySeven) : 36 < x.val := x.le

-- TODO: fix
/--
info: theorem AtLeastThirtySeven.le : ∀ (self : AtLeastThirtySeven), 37 ≤ self.val :=
info: def AtLeastThirtySeven.le : ∀ (self : AtLeastThirtySeven), 37 ≤ self.val :=
fun self => self.2
-/
#guard_msgs in
Expand Down