lean4-htt/tests/lean/run/projWithIrrelevantFields.lean
Cameron Zwarich a6e2df6250
fix: don't treat types with erased constructor types as having trivial structure (#8634)
This PR makes `hasTrivialStructure?` return false for types whose
constructors have types that are erased, e.g. if they construct a
`Prop`.
2025-06-04 22:33:44 +00:00

19 lines
349 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

structure S (α : Type) where
a : Nat
b : Nat
nothing : Nonempty α
def f {α : Type} (s : S α) : Nat := s.a
def g {α : Type} (s : S α) : Nat :=
match s with
| .mk _ b _ => b
structure T (α : Type) where
b : Nat
nothing : Nonempty α
def h {α : Type} (s : S α) : T α :=
match s with
| .mk _ b nothing => { b, nothing }