Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when a data type without values is not public, the typechecker shouldn't be able to prove a value is impossible from another namespace #2759

Open
redfish64 opened this issue Nov 7, 2022 · 0 comments

Comments

@redfish64
Copy link
Contributor

redfish64 commented Nov 7, 2022

If you create a non-public datatype with no values in namespace A, then namespace B can see that.

https://gist.github.com/redfish64/9bbc6b34d1136ce4114b7a2b58c62075

namespace A
  export
  data X = Xa | Xb

  export
  data Y : Type where

namespace B
  -- if this is uncommmented, errors out like it should
  -- foo : X -> Int
  -- foo Xa = 0
  -- foo Xb = 1

  --this doesn't produce an error, but should
  foo2 : Y -> Int
  foo2 y impossible

Steps to Reproduce

Typecheck

Expected Behavior

-   Errors (1)
`-- X.idr line ...:
While processing left hand side of foo2. Y data values are private.

Observed Behavior

OK!

@redfish64 redfish64 changed the title when a data type with no values is not public, the typechecker shouldn't be able to prove a value is impossible when a data type without values is not public, the typechecker shouldn't be able to prove a value is impossible from another module Nov 7, 2022
@redfish64 redfish64 changed the title when a data type without values is not public, the typechecker shouldn't be able to prove a value is impossible from another module when a data type without values is not public, the typechecker shouldn't be able to prove a value is impossible from another namespace Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant