lean4-htt/tests/compiler/extractClosedMutualBlock.lean
Leonardo de Moura 28d81ee456 fix: do not extract closed terms containing constants being defined
It may produce crashes during initialization.
2021-09-30 12:46:38 -07:00

20 lines
418 B
Text

inductive Foo
| mk: (Int -> Foo) -> Foo
| terminal: Foo
deriving Inhabited
mutual
partial def even (_: Unit) : Foo :=
Foo.mk (fun i => odd () )
partial def odd (_: Unit) : Foo :=
Foo.mk (fun i => even ())
end
def hasLayer (f: Foo) : Bool :=
match f with
| Foo.mk _ => true
| Foo.terminal => false
def main : IO Unit := do
IO.println (if hasLayer (odd ()) then "LAYER" else "TERMINAL")
return ()