Commit graph

6 commits

Author SHA1 Message Date
Sebastian Ullrich
de180e5c7a fix: private + pp.fullNames 2022-12-21 21:59:05 +01:00
Sebastian Ullrich
eaafd36918 feat: use signature pretty printer in #check id/#check @id 2022-12-21 21:59:05 +01:00
Sebastian Ullrich
b2b78eb222 test: use printMessageEndPos for leantests 2021-01-15 16:27:59 +01:00
Sebastian Ullrich
3834a89cdc feat: activate new pretty printer 2020-09-17 08:12:28 -07:00
Leonardo de Moura
fb6dfa4af2 chore: fix test 2020-07-13 16:22:48 -07:00
Leonardo de Moura
7322345768 fix: private names
@Kha I tried to fix a few issues with private names. The new test
tries to cover them. If you have more, please create an issue.

1- Scoping. A private declaration should shadow one in a previous scope.
2- We should not be able to define the same `private` in the same
module more than once.
   ```
   private def x := 10
   private def x := "hello" -- should produce error here
   ```
3- Dot-notation should work with private declarations in the module
where they were defined.
4- The following should work
   ```
   namespace N
   private def x := 10
   end N
   #check N.x
   ```
5- The following should **not** work
   ```
   def y := 10
   private def y := "hello" -- produce error

   private def z := 10
   def z := "hello" -- produce error
   ```
   BTW, I am happy to change this behavior. I just mimicked C's
   behavior for `static`.

It is not clear whether the following should work or not.
```
    namespace N
      private def b := 10
    end N
    open N
    #check b
```
2020-04-09 16:28:21 -07:00