lean4-htt/tests/lean/prvCtor.lean

27 lines
534 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.

import Lean
private def a := 10
#check a
structure Name (x : String) where
private mk ::
val : String := x
deriving Repr
def n1 : Name "hello" := {}
def n2 : Name "hello" := ⟨"hello"⟩
def n3 : Name "hello" := Name.mk "hello"
open Lean in
#eval id (α := CoreM Unit) do modifyEnv fun env => { env with header.mainModule := `foo } -- change module name to test `private`
#check a -- Error
def m1 : Name "hello" := {} -- Error
def m2 : Name "hello" := ⟨"hello"⟩ -- Error
def m3 : Name "hello" := Name.mk "hello"