Skip to content

Commit

Permalink
expand tests to include ambient and directly specified universes
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkeizer committed Dec 11, 2024
1 parent 20d4a2c commit 76aec16
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions tests/lean/run/derivingToExpr.lean
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ open Lean

deriving instance ToExpr for ULift

-- Test with empty type
inductive Empty'
deriving ToExpr

-- Test without universes
inductive MonoOption' (α : Type) : Type
| some (a : α)
| none
deriving ToExpr

-- Test with a universe polymporphic type parameter
inductive Option' (α : Type u)
| some (a : α)
Expand Down Expand Up @@ -42,9 +52,28 @@ inductive List' (α : Type u)
| nil
deriving ToExpr

-- Test without (universe) auto implicit
set_option autoImplicit false in
-- Tests without (universe) auto implicits
section NoAutoImplicit
set_option autoImplicit false

-- Test with universe specified directly on the type
inductive ExplicitList'.{u} (α : Type u)
| cons (a : α) (as : List' α)
| nil
deriving ToExpr

-- Test with ambient (explicit) universe
universe u in
inductive AmbientList' (α : Type u)
| cons (a : α) (as : List' α)
| nil
deriving ToExpr

-- Now, test both ambient and directly specified universes
universe u in
structure ExplicitAmbientPair.{v} (α : Type u) (β : Type v) where
a : α
b : β
deriving ToExpr

end NoAutoImplicit

0 comments on commit 76aec16

Please sign in to comment.