-
Notifications
You must be signed in to change notification settings - Fork 450
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: circular assignment at structure instance elaborator
This PR fixes a stack overflow caused by a cyclic assignment in the metavariable context. The cycle is unintentionally introduced by the structure instance elaborator. closes #3150
- Loading branch information
1 parent
9a85433
commit 57cd136
Showing
2 changed files
with
34 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
class One (α : Type) where | ||
one : α | ||
|
||
variable (R A : Type) [One R] [One A] | ||
|
||
class OneHom where | ||
toFun : R → A | ||
map_one : toFun One.one = One.one | ||
|
||
structure Subone where | ||
mem : R → Prop | ||
one_mem : mem One.one | ||
|
||
structure Subalgebra [OneHom R A] extends Subone A : Type where | ||
algebraMap_mem : ∀ r : R, mem (OneHom.toFun r) | ||
one_mem := OneHom.map_one (R := R) (A := A) ▸ algebraMap_mem One.one | ||
|
||
/-- | ||
error: fields missing: 'one_mem' | ||
-/ | ||
#guard_msgs in | ||
example [OneHom R A] : Subalgebra R A where | ||
mem := _ | ||
algebraMap_mem := _ |