Skip to content

Commit 6bb6ced

Browse files
committed
Remove name visibility check
It doesn't seem to serve any useful purpose, other than to annoy!
1 parent 950431a commit 6bb6ced

File tree

3 files changed

+0
-31
lines changed

3 files changed

+0
-31
lines changed

src/TTImp/ProcessData.idr

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,6 @@ checkCon {vars} opts nest env vis tn_in tn (MkImpTy fc cn_in ty_raw)
111111
Public => do addHashWithNames cn
112112
addHashWithNames fullty
113113
_ => pure ()
114-
115-
-- Check name visibility: unless it's a private name, any names in
116-
-- the type must be greater than private
117-
when (vis /= Private) $
118-
traverse_ (checkRefVisibility fc cn vis Private)
119-
(keys (getRefs (UN "") fullty))
120114
pure (MkCon fc cn !(getArity defs [] fullty) fullty)
121115

122116
conName : Constructor -> Name
@@ -288,13 +282,6 @@ processData {vars} eopts nest env fc vis (MkImpLater dfc n_in ty_raw)
288282
_ => do addHashWithNames n
289283
addHashWithNames fullty
290284

291-
-- Check name visibility: unless it's a private name, any names in
292-
-- the type must be greater than private
293-
when (vis /= Private) $
294-
traverse_ (checkRefVisibility fc n vis Private)
295-
(keys (getRefs (UN "") fullty))
296-
pure ()
297-
298285
processData {vars} eopts nest env fc vis (MkImpData dfc n_in ty_raw opts cons_raw)
299286
= do n <- inCurrentNS n_in
300287
ty_raw <- bindTypeNames [] vars ty_raw

src/TTImp/ProcessType.idr

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -275,11 +275,6 @@ processType {vars} eopts nest env fc rig vis opts (MkImpTy tfc n_in ty_raw)
275275

276276
def <- initDef n env ty opts
277277
let fullty = abstractFullEnvType tfc env ty
278-
-- Check name visibility: unless it's a private name, any names in
279-
-- the type must be greater than private
280-
when (vis /= Private) $
281-
traverse_ (checkRefVisibility fc n vis Private)
282-
(keys (getRefs (UN "") fullty))
283278

284279
(erased, dterased) <- findErased fullty
285280
defs <- get Ctxt

src/TTImp/Utils.idr

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -350,16 +350,3 @@ uniqueName defs used n
350350
next str
351351
= let (n, i) = nameNum str in
352352
n ++ "_" ++ show (i + 1)
353-
354-
export
355-
checkRefVisibility : {auto c : Ref Ctxt Defs} ->
356-
FC -> Name ->
357-
Visibility -> -- Visibility of the name
358-
Visibility -> -- Minimum visibility of references
359-
Name -> Core ()
360-
checkRefVisibility fc fn vis min ref
361-
= do defs <- get Ctxt
362-
Just gdef <- lookupCtxtExact ref (gamma defs)
363-
| Nothing => pure ()
364-
when (visibility gdef <= min) $
365-
throw (VisibilityError fc vis fn (visibility gdef) ref)

0 commit comments

Comments
 (0)