test(tests/lean/sec_notation2): notation nested in namespace/section/section
This commit is contained in:
parent
52e9ad1a98
commit
ce153d01f9
2 changed files with 41 additions and 0 deletions
36
tests/lean/sec_notation2.lean
Normal file
36
tests/lean/sec_notation2.lean
Normal file
|
@ -0,0 +1,36 @@
|
|||
open nat
|
||||
|
||||
namespace foo
|
||||
|
||||
section
|
||||
section
|
||||
parameter (A : Type)
|
||||
definition f (a b : A) : A := a
|
||||
|
||||
definition add2 (a : nat) : nat := a + 2
|
||||
|
||||
postfix `+.2`:100 := add2
|
||||
|
||||
local postfix `++2`:100 := add2
|
||||
|
||||
eval 3 +.2
|
||||
|
||||
example : 3 +.2 = 3 ++2 := rfl
|
||||
end
|
||||
|
||||
eval 3 +.2
|
||||
|
||||
example : 3 +.2 = 3 ++2 := rfl -- error
|
||||
|
||||
end
|
||||
|
||||
eval 3 +.2
|
||||
end foo
|
||||
|
||||
example : 3 +.2 = 5 := -- error
|
||||
rfl
|
||||
|
||||
open foo
|
||||
|
||||
example : 3 +.2 = 5 := -- error
|
||||
rfl
|
5
tests/lean/sec_notation2.lean.expected.out
Normal file
5
tests/lean/sec_notation2.lean.expected.out
Normal file
|
@ -0,0 +1,5 @@
|
|||
5
|
||||
5
|
||||
sec_notation2.lean:23:21: error: invalid expression
|
||||
5
|
||||
sec_notation2.lean:30:13: error: invalid expression
|
Loading…
Reference in a new issue