File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,8 @@ def hasTrivialStructure? (declName : Name) : CoreM (Option TrivialStructureInfo)
4646 let .inductInfo info ← getConstInfo declName | return none
4747 if info.isUnsafe || info.isRec then return none
4848 let [ctorName] := info.ctors | return none
49+ let ctorType ← getOtherDeclBaseType ctorName []
50+ if ctorType.isErased then return none
4951 let mask ← getRelevantCtorFields ctorName
5052 let mut result := none
5153 for h : i in [:mask.size] do
Original file line number Diff line number Diff line change 1+ structure S (α : Type ) where
2+ a : Nat
3+ b : Nat
4+ nothing : Nonempty α
5+
6+ def f {α : Type } (s : S α) : Nat := s.a
7+
8+ def g {α : Type } (s : S α) : Nat :=
9+ match s with
10+ | .mk _ b _ => b
11+
12+ structure T (α : Type ) where
13+ b : Nat
14+ nothing : Nonempty α
15+
16+ def h {α : Type } (s : S α) : T α :=
17+ match s with
18+ | .mk _ b nothing => { b, nothing }
19+
You can’t perform that action at this time.
0 commit comments