chore: add a test for #2602, which was fixed by the new compiler (#8902)

This commit is contained in:
Cameron Zwarich 2025-06-20 10:37:19 -07:00 committed by GitHub
parent cf527e05bd
commit 8d8c73416a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

13
tests/lean/run/2602.lean Normal file
View file

@ -0,0 +1,13 @@
inductive Units : Bool → Type where
| seconds : Units false
| hours : Units true
open Units
structure Quantity (d : Bool) : Type where
quantity : Unit
units : Units d
instance (d : Bool) : ToString (Quantity d) where
toString q := match q.units with | seconds => "seconds" | hours => "hours"